X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Ffdset.c;h=d2ea665016b54b49f48d8496af7fa96911560723;hp=fd27398ebbec75f7a3554882fc7e017d1128ae5d;hb=e1d758033dc7e101ab32323a0f1649d8daf56a22;hpb=f934051c4d17d167bd8e46dd3c70a745e26fd2eb diff --git a/src/shared/fdset.c b/src/shared/fdset.c index fd27398eb..d2ea66501 100644 --- a/src/shared/fdset.c +++ b/src/shared/fdset.c @@ -82,7 +82,7 @@ int fdset_put_dup(FDSet *s, int fd) { r = fdset_put(s, copy); if (r < 0) { - close_nointr_nofail(copy); + safe_close(copy); return r; } @@ -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));