]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Save lines with direct initialization
authorVolker Lendecke <vl@samba.org>
Mon, 1 Dec 2025 18:28:27 +0000 (19:28 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Jan 2026 09:57:40 +0000 (09:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/lib/util_sock.c

index 3b543ebba15bf56d2f8a7231eb6ead71e01bee32..44c38de5ccfebda53db68ea5022363b63922ca8e 100644 (file)
@@ -1113,12 +1113,9 @@ bool is_myname_or_ipaddr(const char *s)
 
 int poll_one_fd(int fd, int events, int timeout, int *revents)
 {
-       struct pollfd pfd;
+       struct pollfd pfd = {.fd = fd, .events = events};
        int ret;
 
-       pfd.fd = fd;
-       pfd.events = events;
-
        ret = poll(&pfd, 1, timeout);
 
        /*
@@ -1131,12 +1128,9 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
 
 int poll_intr_one_fd(int fd, int events, int timeout, int *revents)
 {
-       struct pollfd pfd;
+       struct pollfd pfd = {.fd = fd, .events = events};
        int ret;
 
-       pfd.fd = fd;
-       pfd.events = events;
-
        ret = sys_poll_intr(&pfd, 1, timeout);
        if (ret <= 0) {
                *revents = 0;