summaryrefslogtreecommitdiff
path: root/src/import/importd.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-23 01:00:04 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:08:37 +0200
commit3ee897d6c2401effbc82f5eef35fce405781d6c8 (patch)
tree86d1d6e0c432a22aba4d51dee56015f8b85d8b9b /src/import/importd.c
parent400f1a33cf63ddaa41af5d5b0bcd5be73e0404a6 (diff)
tree-wide: port more code to use send_one_fd() and receive_one_fd()
Also, make it slightly more powerful, by accepting a flags argument, and make it safe for handling if more than one cmsg attribute happens to be attached.
Diffstat (limited to 'src/import/importd.c')
-rw-r--r--src/import/importd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/import/importd.c b/src/import/importd.c
index c90ada5da4..a29e9d4bd5 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -600,11 +600,11 @@ static int manager_on_notify(sd_event_source *s, int fd, uint32_t revents, void
cmsg_close_all(&msghdr);
- CMSG_FOREACH(cmsg, &msghdr) {
- if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDENTIALS && cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
-
+ CMSG_FOREACH(cmsg, &msghdr)
+ if (cmsg->cmsg_level == SOL_SOCKET &&
+ cmsg->cmsg_type == SCM_CREDENTIALS &&
+ cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
ucred = (struct ucred*) CMSG_DATA(cmsg);
- }
if (msghdr.msg_flags & MSG_TRUNC) {
log_warning("Got overly long notification datagram, ignoring.");