diff options
author | 2016-12-08 15:34:08 +0300 | |
---|---|---|
committer | 2016-12-09 19:32:07 +0300 | |
commit | da26d69cb1b21d582a81af0cad7342fab6596eed (patch) | |
tree | 18c24336e664111ba9c3a5bfedec5c340ec0a19d /sway/ipc-server.c | |
parent | Use return value of write (diff) | |
download | sway-da26d69cb1b21d582a81af0cad7342fab6596eed.tar.gz sway-da26d69cb1b21d582a81af0cad7342fab6596eed.tar.zst sway-da26d69cb1b21d582a81af0cad7342fab6596eed.zip |
Fix build on FreeBSD
- Make sure CMake always finds absolute paths for Cairo, Pango and GdkPixbuf
- Add forgotten json-c include path to swaymsg/CMakeLists.txt
- Disable -Werror because of assert warnings
- Add correct /proc/pid/file path for FreeBSD
- Use libepoll-shim on FreeBSD
- Only use Linux capabilities on, well, Linux
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) { | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static pid_t get_client_pid(int client_fd) { | 128 | static pid_t get_client_pid(int client_fd) { |
129 | // FreeBSD supports getting uid/gid, but not pid | ||
130 | #ifdef __linux__ | ||
129 | struct ucred ucred; | 131 | struct ucred ucred; |
130 | socklen_t len = sizeof(struct ucred); | 132 | socklen_t len = sizeof(struct ucred); |
131 | 133 | ||
@@ -134,6 +136,9 @@ static pid_t get_client_pid(int client_fd) { | |||
134 | } | 136 | } |
135 | 137 | ||
136 | return ucred.pid; | 138 | return ucred.pid; |
139 | #else | ||
140 | return -1; | ||
141 | #endif | ||
137 | } | 142 | } |
138 | 143 | ||
139 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { | 144 | int ipc_handle_connection(int fd, uint32_t mask, void *data) { |