tree-wide: use structured initialization at various places

This commit is contained in:
Lennart Poettering
2020-04-24 07:44:42 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 2efa5bc6fa
commit 41ab8c67eb
8 changed files with 64 additions and 57 deletions
+6 -6
View File
@@ -860,7 +860,6 @@ int ask_password_agent(
for (;;) {
char passphrase[LINE_MAX+1];
struct msghdr msghdr;
struct iovec iovec;
struct ucred *ucred;
union {
@@ -919,11 +918,12 @@ int ask_password_agent(
iovec = IOVEC_MAKE(passphrase, sizeof(passphrase));
zero(control);
zero(msghdr);
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;
msghdr.msg_control = &control;
msghdr.msg_controllen = sizeof(control);
struct msghdr msghdr = {
.msg_iov = &iovec,
.msg_iovlen = 1,
.msg_control = &control,
.msg_controllen = sizeof(control),
};
n = recvmsg_safe(socket_fd, &msghdr, 0);
if (IN_SET(n, -EAGAIN, -EINTR))
+3 -2
View File
@@ -243,8 +243,9 @@ int socket_address_parse_netlink(SocketAddress *a, const char *s) {
assert(a);
assert(s);
zero(*a);
a->type = SOCK_RAW;
*a = (SocketAddress) {
.type = SOCK_RAW,
};
r = extract_first_word(&s, &word, NULL, 0);
if (r < 0)