projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6361eb
)
notify_systemd: use close-on-exit on socket
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Tue, 8 Sep 2015 14:11:56 +0000
(16:11 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 14 Sep 2015 18:40:35 +0000
(20:40 +0200)
src/daemon/collectd.c
patch
|
blob
|
history
diff --git
a/src/daemon/collectd.c
b/src/daemon/collectd.c
index
58325b9
..
02fd66f
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-459,7
+459,11
@@
int notify_systemd (void)
unsetenv ("NOTIFY_SOCKET");
+#if defined(SOCK_CLOEXEC)
+ fd = socket (AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, /* protocol = */ 0);
+#else
fd = socket (AF_UNIX, SOCK_DGRAM, /* protocol = */ 0);
+#endif
if (fd < 0) {
char errbuf[1024];
ERROR ("creating UNIX socket failed: %s",