diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-06 09:10:16 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-06 09:10:16 -0500 |
commit | d93e53fd4b57c478097aee899da8226acfe3d318 (patch) | |
tree | 3bc1f767ab51f8799b453805f19dab13afa4b622 /sway | |
parent | Decrement expected_len (diff) | |
download | sway-d93e53fd4b57c478097aee899da8226acfe3d318.tar.gz sway-d93e53fd4b57c478097aee899da8226acfe3d318.tar.zst sway-d93e53fd4b57c478097aee899da8226acfe3d318.zip |
Use return value of write
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc-server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index c04c465a..815b232b 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -158,7 +158,9 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { | |||
158 | if (!(get_feature_policy(pid) & FEATURE_IPC)) { | 158 | if (!(get_feature_policy(pid) & FEATURE_IPC)) { |
159 | sway_log(L_INFO, "Permission to connect to IPC socket denied to %d", pid); | 159 | sway_log(L_INFO, "Permission to connect to IPC socket denied to %d", pid); |
160 | const char *error = "{\"success\": false, \"message\": \"Permission denied\"}"; | 160 | const char *error = "{\"success\": false, \"message\": \"Permission denied\"}"; |
161 | write(client_fd, &error, sizeof(error)); | 161 | if (write(client_fd, &error, sizeof(error)) < (int)sizeof(error)) { |
162 | sway_log(L_DEBUG, "Failed to write entire error"); | ||
163 | } | ||
162 | close(client_fd); | 164 | close(client_fd); |
163 | return 0; | 165 | return 0; |
164 | } | 166 | } |