chiark / gitweb /
use more _cleanup_ macro
[elogind.git] / src / shared / fdset.c
index a2c861de3f4b0486f7fbb742e717237555b16c09..d2ea665016b54b49f48d8496af7fa96911560723 100644 (file)
@@ -104,7 +104,7 @@ int fdset_remove(FDSet *s, int fd) {
 }
 
 int fdset_new_fill(FDSet **_s) {
-        DIR *d;
+        _cleanup_closedir_ DIR *d = NULL;
         struct dirent *de;
         int r = 0;
         FDSet *s;
@@ -150,8 +150,6 @@ int fdset_new_fill(FDSet **_s) {
         s = NULL;
 
 finish:
-        closedir(d);
-
         /* We won't close the fds here! */
         if (s)
                 set_free(MAKE_SET(s));