summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-13 17:15:41 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-13 17:18:36 +0100
commit95eb099fa8a90212ed2aef82bad360f147bc19c2 (patch)
tree55d41db4fa3d15f31feaf0299429057cff3b0cb7 /src
parent557b5d4a94967198b3181fcb83879d4569cbf456 (diff)
bus-proxy: close each connection fd only once
After passing the fds over to the sd_bus object, we should forget them, so that we don't close them a second time when the object goes away.
Diffstat (limited to 'src')
-rw-r--r--src/bus-proxyd/bus-proxyd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index e07761aeb9..478dd78744 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -69,7 +69,7 @@ static ClientContext *client_context_free(ClientContext *c) {
if (!c)
return NULL;
- close(c->fd);
+ safe_close(c->fd);
free(c);
return NULL;
@@ -101,6 +101,8 @@ static void *run_client(void *userdata) {
if (r < 0)
goto exit;
+ c->fd = -1;
+
/* set comm to "p$PIDu$UID" and suffix with '*' if truncated */
r = snprintf(comm, sizeof(comm), "p" PID_FMT "u" UID_FMT, p->local_creds.pid, p->local_creds.uid);
if (r >= (ssize_t)sizeof(comm))