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
(from parent 1:
557b5d4
)
bus-proxy: close each connection fd only once
author
Lennart Poettering
<lennart@poettering.net>
Fri, 13 Feb 2015 16:15:41 +0000
(17:15 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 13 Feb 2015 16:18:36 +0000
(17:18 +0100)
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.
src/bus-proxyd/bus-proxyd.c
patch
|
blob
|
history
diff --git
a/src/bus-proxyd/bus-proxyd.c
b/src/bus-proxyd/bus-proxyd.c
index e07761aeb937cc261cbee9f5bc8ec10ae18682c1..478dd78744eb6d6639cbb49f2ebf2d30b44d438d 100644
(file)
--- 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))