bus: properly handle termination of connections

This commit is contained in:
Lennart Poettering
2013-03-25 02:33:35 +01:00
parent 2c93b4efec
commit 66f931b4c8
+4
View File
@@ -532,6 +532,8 @@ static int bus_read_auth(sd_bus *b) {
k = recvmsg(b->fd, &mh, MSG_DONTWAIT|MSG_NOSIGNAL);
if (k < 0)
return errno == EAGAIN ? 0 : -errno;
if (k == 0)
return -ECONNRESET;
b->rbuffer_size += k;
@@ -1058,6 +1060,8 @@ static int message_read(sd_bus *bus, sd_bus_message **m) {
k = recvmsg(bus->fd, &mh, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
if (k < 0)
return errno == EAGAIN ? 0 : -errno;
if (k == 0)
return -ECONNRESET;
bus->rbuffer_size += k;