chiark / gitweb /
Prep v220: Apply "Fixes to user and session saving"
[elogind.git] / src / shared / fdset.c
index 9e35ce5cecc55b00e36093c26d26f0b587230dc4..a4823e6659623602d71227929e797d83d87e38ef 100644 (file)
@@ -22,7 +22,6 @@
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
-#include <unistd.h>
 
 #include "set.h"
 #include "util.h"
@@ -33,7 +32,7 @@
 #define MAKE_SET(s) ((Set*) s)
 #define MAKE_FDSET(s) ((FDSet*) s)
 
-/* Make sure we can distuingish fd 0 and NULL */
+/* Make sure we can distinguish fd 0 and NULL */
 #define FD_TO_PTR(fd) INT_TO_PTR((fd)+1)
 #define PTR_TO_FD(p) (PTR_TO_INT(p)-1)
 
@@ -268,8 +267,7 @@ bool fdset_isempty(FDSet *fds) {
 int fdset_iterate(FDSet *s, Iterator *i) {
         void *p;
 
-        p = set_iterate(MAKE_SET(s), i);
-        if (!p)
+        if (!set_iterate(MAKE_SET(s), i, &p))
                 return -ENOENT;
 
         return PTR_TO_FD(p);