]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/fdset.c
Define FOREACH_DIRENT through FOREACH_DIRENT_ALL
[thirdparty/systemd.git] / src / shared / fdset.c
index 89d118a3aa9c4532550407a6f7e1a9a214dbc6b5..183fa239b6d2cd1ba00d374374eb351ad7e6747b 100644 (file)
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <errno.h>
 #include <fcntl.h>
@@ -112,7 +112,6 @@ int fdset_remove(FDSet *s, int fd) {
 
 int fdset_new_fill(FDSet **_s) {
         _cleanup_closedir_ DIR *d = NULL;
-        struct dirent *de;
         int r = 0;
         FDSet *s;
 
@@ -161,13 +160,12 @@ finish:
 }
 
 int fdset_cloexec(FDSet *fds, bool b) {
-        Iterator i;
         void *p;
         int r;
 
         assert(fds);
 
-        SET_FOREACH(p, MAKE_SET(fds), i) {
+        SET_FOREACH(p, MAKE_SET(fds)) {
                 r = fd_cloexec(PTR_TO_FD(p), b);
                 if (r < 0)
                         return r;
@@ -209,7 +207,6 @@ fail:
 
 int fdset_close_others(FDSet *fds) {
         void *e;
-        Iterator i;
         int *a = NULL;
         size_t j = 0, m;
 
@@ -217,7 +214,7 @@ int fdset_close_others(FDSet *fds) {
 
         if (m > 0) {
                 a = newa(int, m);
-                SET_FOREACH(e, MAKE_SET(fds), i)
+                SET_FOREACH(e, MAKE_SET(fds))
                         a[j++] = PTR_TO_FD(e);
         }