summaryrefslogtreecommitdiffstats
path: root/src/shared/fdset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/fdset.c')
-rw-r--r--src/shared/fdset.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/fdset.c b/src/shared/fdset.c
index e5b8e92..cb5a69e 100644
--- a/src/shared/fdset.c
+++ b/src/shared/fdset.c
@@ -3,6 +3,7 @@
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
+#include <unistd.h>
#include "sd-daemon.h"
@@ -40,8 +41,8 @@ int fdset_new_array(FDSet **ret, const int fds[], size_t n_fds) {
if (!s)
return -ENOMEM;
- for (size_t i = 0; i < n_fds; i++) {
- r = fdset_put(s, fds[i]);
+ FOREACH_ARRAY(fd, fds, n_fds) {
+ r = fdset_put(s, *fd);
if (r < 0)
return r;
}
@@ -71,7 +72,7 @@ void fdset_close(FDSet *s) {
log_debug("Closing set fd %i (%s)", fd, strna(path));
}
- (void) close_nointr(fd);
+ (void) close(fd);
}
}
@@ -246,7 +247,7 @@ int fdset_new_listen_fds(FDSet **ret, bool unset) {
return -ENOMEM;
n = sd_listen_fds(unset);
- for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd ++) {
+ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) {
r = fdset_put(s, fd);
if (r < 0)
return r;