X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=6c856a6b0c7ea6fbdc543974979601e9e070c8bf;hb=7a8cd12cc66a349106a34a7655944cfeac71d7c5;hp=3ae61d8592e5df6b3f42986f0e1131ef5682ace3;hpb=68c08bd380d63281f5707e893c27f952c5fde1d8;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; } }