summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-daemon
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-10-09 17:32:30 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2015-10-09 17:32:30 +0200
commit88ef5e639b30b53b3663f766874dc519908de74d (patch)
tree6d03c9d5d3391283e37a6e44d2a34263678f7cbb /src/libsystemd/sd-daemon
parent2c882b8bfa29937fb808fa1dd60c2a7ab0e8e85e (diff)
parent417800228f69db9ff37f4193d11508757dd09308 (diff)
Merge pull request #1516 from poettering/dontisolaterootslice
Don't isolate `-.slice`
Diffstat (limited to 'src/libsystemd/sd-daemon')
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 437518119b..582fb53529 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -450,8 +450,10 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
if (n_fds > 0 || have_pid) {
/* CMSG_SPACE(0) may return value different then zero, which results in miscalculated controllen. */
- msghdr.msg_controllen = (n_fds ? CMSG_SPACE(sizeof(int) * n_fds) : 0) +
- CMSG_SPACE(sizeof(struct ucred)) * have_pid;
+ msghdr.msg_controllen =
+ (n_fds > 0 ? CMSG_SPACE(sizeof(int) * n_fds) : 0) +
+ (have_pid ? CMSG_SPACE(sizeof(struct ucred)) : 0);
+
msghdr.msg_control = alloca(msghdr.msg_controllen);
cmsg = CMSG_FIRSTHDR(&msghdr);