aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-12 19:10:43 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-12 19:10:43 +0100
commitc7cbdf0139cae2445b62df2af5f7a64b4ab925dc (patch)
tree4a0d7e5dccace2dc4bc4f630f06f2b0cf278e067
parent4b9165a7f4f0461cdc16e95804c8ccc5cab50644 (diff)
downloadimv-c7cbdf0139cae2445b62df2af5f7a64b4ab925dc.tar.gz
ipc: Handle closed socket correctly
-rw-r--r--src/ipc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 745433f..f5f3e46 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -35,7 +35,7 @@ void *wait_for_commands(void* void_conn)
while (1) {
char buf[1024];
ssize_t len = recv(conn->fd, buf, sizeof buf - 1, 0);
- if (len == -1) {
+ if (len <= 0) {
break;
}