chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use initalization instead of explicit zeroing
[elogind.git]
/
src
/
nspawn
/
nspawn.c
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index 01ef12bf67bbbf0dda4095bad7d2bb037988dd15..b90ccc53ef51fae8d4ffaf29cb7ce6463761a789 100644
(file)
--- 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))];
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);
struct cmsghdr *cmsg;
assert(dest);
@@
-716,12
+719,6
@@
static int setup_kmsg(const char *dest, int kmsg_socket) {
return -errno;
}
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;
cmsg = CMSG_FIRSTHDR(&mh);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;