diff options
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r-- | src/nspawn/nspawn.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 01ef12bf67..b90ccc53ef 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -674,8 +674,11 @@ static int setup_kmsg(const char *dest, int kmsg_socket) { union { struct cmsghdr cmsghdr; uint8_t buf[CMSG_SPACE(sizeof(int))]; - } control; - struct msghdr mh; + } control = {}; + struct msghdr mh = { + .msg_control = &control, + .msg_controllen = sizeof(control), + }; struct cmsghdr *cmsg; assert(dest); @@ -716,12 +719,6 @@ static int setup_kmsg(const char *dest, int kmsg_socket) { return -errno; } - zero(mh); - zero(control); - - mh.msg_control = &control; - mh.msg_controllen = sizeof(control); - cmsg = CMSG_FIRSTHDR(&mh); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; |