chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c93b4e
)
bus: properly handle termination of connections
author
Lennart Poettering
<lennart@poettering.net>
Sun, 24 Mar 2013 22:54:44 +0000
(23:54 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 25 Mar 2013 01:33:35 +0000
(
02:33
+0100)
src/libsystemd-bus/sd-bus.c
patch
|
blob
|
history
diff --git
a/src/libsystemd-bus/sd-bus.c
b/src/libsystemd-bus/sd-bus.c
index 72c790bd59a72108d67d2f1f65824db7a13b988a..941b33ab695f62074f8f2a2e58fb6e0bf8524d78 100644
(file)
--- a/
src/libsystemd-bus/sd-bus.c
+++ b/
src/libsystemd-bus/sd-bus.c
@@
-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;