summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-12-17 14:18:48 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-12-17 14:18:48 +0100
commiteece9692d707ccb20356ec06955f8308c4e59ca7 (patch)
tree55186434884960d25d11736c8f846876d568fa08 /src/socket.c
parent987942a206ef0f2342bf81d5de6432c6af42b7e7 (diff)
New upstream version 4.19upstream/4.19
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/socket.c b/src/socket.c
index e2ad9ed..9fdd903 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -394,13 +394,15 @@ EXPORT_SYMBOL int HX_socket_from_env(const struct addrinfo *ai, const char *intf
}
top_fd = x;
}
- for (int fd = 3; fd < top_fd; ++fd)
- if (try_sk_from_env(fd, ai, intf) == fd) {
+ for (int fd = 3; fd < top_fd; ++fd) {
+ if (try_sk_from_env(fd, ai, intf) != fd)
+ continue;
#ifdef SOCK_CLOEXEC
- fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
+ if (fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC) != 0)
+ /* ignore */;
#endif
- return fd;
- }
+ return fd;
+ }
errno = ENOENT;
return -1;
}