udevd: inline iterator variable

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2024-02-21 14:09:52 +01:00
parent 5ea4afcf00
commit 4bf32eac52

View File

@@ -33,16 +33,15 @@ static int arg_daemonize = false;
static int listen_fds(int *ret_ctrl, int *ret_netlink) {
int ctrl_fd = -EBADF, netlink_fd = -EBADF;
int fd, n;
assert(ret_ctrl);
assert(ret_netlink);
n = sd_listen_fds(true);
int n = sd_listen_fds(true);
if (n < 0)
return n;
for (fd = SD_LISTEN_FDS_START; fd < n + SD_LISTEN_FDS_START; fd++) {
for (int fd = SD_LISTEN_FDS_START; fd < n + SD_LISTEN_FDS_START; fd++) {
if (sd_is_socket(fd, AF_UNIX, SOCK_SEQPACKET, -1) > 0) {
if (ctrl_fd >= 0)
return -EINVAL;