diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-03-31 02:00:44 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-03-31 06:48:03 -0700 |
commit | 9f81a592c19a7390eefaca99e8323f13d69c2044 (patch) | |
tree | 624531d0769c3741e0f4d8ed77eb40c6ffb3bb07 /src/basic/stat-util.c | |
parent | f61457b0fee7326ead5b2cd8df8515a814d922e0 (diff) | |
download | systemd-9f81a592c19a7390eefaca99e8323f13d69c2044.tar.gz |
*: convert amenable fdopendir() calls to take_fdopendir()
Some fdopendir() calls remain where safe_close() is manually
performed, those could be simplified as well by converting to
use the _cleanup_close_ machinery, but makes things less trivial
to review so left for a future cleanup.
Diffstat (limited to 'src/basic/stat-util.c')
-rw-r--r-- | src/basic/stat-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 8ef90e96b7..5412ccbf7d 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -10,6 +10,7 @@ #include "alloc-util.h" #include "dirent-util.h" #include "fd-util.h" +#include "fileio.h" #include "fs-util.h" #include "macro.h" #include "missing_fs.h" @@ -77,10 +78,9 @@ int dir_is_empty_at(int dir_fd, const char *path) { if (fd < 0) return -errno; - d = fdopendir(fd); + d = take_fdopendir(&fd); if (!d) return -errno; - fd = -1; FOREACH_DIRENT(de, d, return -errno) return 0; |