diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-11 14:07:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-11 14:07:08 -0500 |
commit | 6350752d6be2abfac68aa16e891dd859aa5cdafa (patch) | |
tree | 18c24336e664111ba9c3a5bfedec5c340ec0a19d /sway/ipc-server.c | |
parent | d93e53fd4b57c478097aee899da8226acfe3d318 (diff) | |
parent | da26d69cb1b21d582a81af0cad7342fab6596eed (diff) |
Merge pull request #985 from myfreeweb/master
Fix build on FreeBSD
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 815b232b..de72beca 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -126,6 +126,8 @@ struct sockaddr_un *ipc_user_sockaddr(void) { } static pid_t get_client_pid(int client_fd) { +// FreeBSD supports getting uid/gid, but not pid +#ifdef __linux__ struct ucred ucred; socklen_t len = sizeof(struct ucred); @@ -134,6 +136,9 @@ static pid_t get_client_pid(int client_fd) { } return ucred.pid; +#else + return -1; +#endif } int ipc_handle_connection(int fd, uint32_t mask, void *data) { |