mirror of
https://github.com/systemd/systemd.git
synced 2025-03-24 14:50:17 +03:00
sd-daemon: simply code simplification
No change in behaviour, just make the code more obvious.
This commit is contained in:
parent
b492ce8a22
commit
c463a6f1c4
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user