diff --git a/src/packet.c b/src/packet.c index 0ea54eb..fcee3ad 100644 --- a/src/packet.c +++ b/src/packet.c @@ -109,7 +109,7 @@ enum FD_STATE read_packet_from_udp (int fd, struct buffer_packet* bp, struct udp return FDS_ERR; } if (nread == -1 && errno == EAGAIN) return FDS_AGAIN; - if (nread == -1 && errno == EAGAIN) return FDS_AGAIN; + if (nread == 0) return FDS_AGAIN; if (nread == -1) { fprintf(stderr, "A system error occured\n"); return FDS_ERR;