aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-12-06 09:10:16 -0500
committerDrew DeVault <sir@cmpwn.com>2016-12-06 09:10:16 -0500
commitd93e53fd4b57c478097aee899da8226acfe3d318 (patch)
tree3bc1f767ab51f8799b453805f19dab13afa4b622
parent979878d8afa44beef7bb32641cba281390ce513b (diff)
Use return value of write
-rw-r--r--sway/ipc-server.c4
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) {
if (!(get_feature_policy(pid) & FEATURE_IPC)) {
sway_log(L_INFO, "Permission to connect to IPC socket denied to %d", pid);
const char *error = "{\"success\": false, \"message\": \"Permission denied\"}";
- write(client_fd, &error, sizeof(error));
+ if (write(client_fd, &error, sizeof(error)) < (int)sizeof(error)) {
+ sway_log(L_DEBUG, "Failed to write entire error");
+ }
close(client_fd);
return 0;
}