diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-07 08:59:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 08:59:29 -0400 |
commit | 4e12bf64ef946f25e602fd609b80349d100a86ed (patch) | |
tree | 695a25ad9476d041ddeab6f45b67160eef6c7f72 /sway/ipc-server.c | |
parent | 270e01ce6db1fd9e42cc2f8466c8411f4a8be2c5 (diff) | |
parent | cf95aebf691be478f1c6cbd925ee528080b1a8f1 (diff) |
Merge pull request #1153 from SirCmpwn/fix-1152
Fix dangling file descriptors (fixes #1152)
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 0cacc515..984e6754 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -161,7 +161,8 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { } int flags; - if ((flags=fcntl(client_fd, F_GETFD)) == -1 || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { + if ((flags = fcntl(client_fd, F_GETFD)) == -1 + || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { sway_log_errno(L_ERROR, "Unable to set CLOEXEC on IPC client socket"); close(client_fd); return 0; @@ -193,13 +194,12 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { if (mask & WLC_EVENT_ERROR) { sway_log(L_ERROR, "IPC Client socket error, removing client"); - client->fd = -1; ipc_client_disconnect(client); return 0; } if (mask & WLC_EVENT_HANGUP) { - client->fd = -1; + sway_log(L_DEBUG, "Client %d hung up", client->fd); ipc_client_disconnect(client); return 0; } |