Created
August 5, 2017 19:00
-
-
Save ilyaluk/4cba205f94b71e5f62d412a615706c20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sway/ipc-server.c b/sway/ipc-server.c | |
index dca881f..7db57ad 100644 | |
--- a/sway/ipc-server.c | |
+++ b/sway/ipc-server.c | |
@@ -168,6 +168,12 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { | |
close(client_fd); | |
return 0; | |
} | |
+ if ((flags = fcntl(client_fd, F_GETFL)) == -1 | |
+ || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { | |
+ sway_log_errno(L_ERROR, "Unable to set NONBLOCK on IPC client socket"); | |
+ close(client_fd); | |
+ return 0; | |
+ } | |
struct ipc_client* client = malloc(sizeof(struct ipc_client)); | |
if (!client) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment