summaryrefslogtreecommitdiffstats
path: root/lib/receiver.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/receiver.c')
-rw-r--r--lib/receiver.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/receiver.c b/lib/receiver.c
index b58e8be..ba7edda 100644
--- a/lib/receiver.c
+++ b/lib/receiver.c
@@ -75,12 +75,9 @@ other_event_received (struct epoll_thread *t, int fd, void *data)
/* sender sends a message, read it and reply */
ssize_t size = icipc_socket_read (fd, &self->buffer_read, &self->buffer_size);
- if (size < 0) {
- icipc_log_error ("receiver: could not read message: %s", strerror(errno));
- return;
- }
-
- if (size == 0) {
+ if (size <= 0) {
+ if (size < 0)
+ icipc_log_error ("receiver: could not read message: %s", strerror(errno));
/* client disconnected */
epoll_ctl (t->epoll_fd, EPOLL_CTL_DEL, fd, NULL);
close (fd);