X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=6c856a6b0c7ea6fbdc543974979601e9e070c8bf;hb=243163d9a20ed9961f6c2eefe59b411b5c39d707;hp=3ae61d8592e5df6b3f42986f0e1131ef5682ace3;hpb=c99e3a4d169ada9299c73e20662d17debdc32e1f;p=collectd.git diff --git a/src/daemon/common.c b/src/daemon/common.c index 3ae61d85..6c856a6b 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -269,7 +269,8 @@ ssize_t swrite(int fd, const void *buf, size_t count) { if (recv(fd, buffer, sizeof(buffer), MSG_PEEK | MSG_DONTWAIT) == 0) { /* if recv returns zero (even though poll() said there is data to be * read), that means the connection has been closed */ - return errno ? errno : -1; + errno = ECONNRESET; + return -1; } }