summaryrefslogtreecommitdiffstats
path: root/sway/ipc.c
diff options
context:
space:
mode:
authorLibravatar minus <minus@mnus.de>2015-08-21 16:53:11 +0200
committerLibravatar minus <minus@mnus.de>2015-08-21 16:53:11 +0200
commit8dfaf6265be52a582cc990f4332808d55063766f (patch)
treef31d5042629c27a6fbba0cb73f2b93433dce247a /sway/ipc.c
parentMinor style fix (diff)
downloadsway-8dfaf6265be52a582cc990f4332808d55063766f.tar.gz
sway-8dfaf6265be52a582cc990f4332808d55063766f.tar.zst
sway-8dfaf6265be52a582cc990f4332808d55063766f.zip
fixed #108 signed/unsigned comparison
Diffstat (limited to 'sway/ipc.c')
-rw-r--r--sway/ipc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/ipc.c b/sway/ipc.c
index 63117def..0b36d758 100644
--- a/sway/ipc.c
+++ b/sway/ipc.c
@@ -121,11 +121,15 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) {
121 } 121 }
122 122
123 int read_available; 123 int read_available;
124 ioctl(client_fd, FIONREAD, &read_available); 124 if (ioctl(client_fd, FIONREAD, &read_available) == -1) {
125 sway_log_errno(L_INFO, "Unable to read IPC socket buffer size");
126 ipc_client_disconnect(client);
127 return 0;
128 }
125 129
126 // Wait for the rest of the command payload in case the header has already been read 130 // Wait for the rest of the command payload in case the header has already been read
127 if (client->payload_length > 0) { 131 if (client->payload_length > 0) {
128 if (read_available >= client->payload_length) { 132 if ((uint32_t)read_available >= client->payload_length) {
129 ipc_client_handle_command(client); 133 ipc_client_handle_command(client);
130 } 134 }
131 else { 135 else {