X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fos_generic.c;h=1c6489b3a6cce1c20f8d1704c814a0dd427bae07;hb=129fc4f6d5f88a86544bf3ad1f9c3c312095ff98;hp=72fba12f21ba657320e01d6ff4d841526bc2731d;hpb=3499d06736c7afcfce2e161d242b854c1692c900;p=ircu2.10.12-pk.git diff --git a/ircd/os_generic.c b/ircd/os_generic.c index 72fba12..1c6489b 100644 --- a/ircd/os_generic.c +++ b/ircd/os_generic.c @@ -450,9 +450,13 @@ IOResult os_recv_nonb(int fd, char* buf, unsigned int length, if (0 < (res = recv(fd, buf, length, 0))) { *count_out = (unsigned) res; return IO_SUCCESS; + } else if (res == 0) { + *count_out = 0; + errno = 0; /* or ECONNRESET? */ + return IO_FAILURE; } else { *count_out = 0; - return (res < 0) && is_blocked(errno) ? IO_BLOCKED : IO_FAILURE; + return is_blocked(errno) ? IO_BLOCKED : IO_FAILURE; } }