From 2a1288ff89322a2f49c79f6d1832c8164c14a05c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Jun 2015 19:10:47 +0200 Subject: util: introduce CMSG_FOREACH() macro and make use of it everywhere It's only marginally shorter then the usual for() loop, but certainly more readable. --- src/udev/udevd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/udev') diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 26aae89990..2affb5944a 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -875,7 +875,7 @@ static int on_worker(sd_event_source *s, int fd, uint32_t revents, void *userdat continue; } - for (cmsg = CMSG_FIRSTHDR(&msghdr); cmsg; cmsg = CMSG_NXTHDR(&msghdr, cmsg)) { + CMSG_FOREACH(cmsg, &msghdr) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDENTIALS && cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) -- cgit v1.2.3-54-g00ecf