summaryrefslogtreecommitdiffstats
path: root/src/basic/copy.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-03-31 11:00:44 +0200
committerVito Caputo <vcaputo@pengaru.com>2020-03-31 15:48:03 +0200
commit9f81a592c19a7390eefaca99e8323f13d69c2044 (patch)
tree624531d0769c3741e0f4d8ed77eb40c6ffb3bb07 /src/basic/copy.c
parentfileio: add take_fdopendir() variant (diff)
downloadsystemd-9f81a592c19a7390eefaca99e8323f13d69c2044.tar.xz
systemd-9f81a592c19a7390eefaca99e8323f13d69c2044.zip
*: 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/copy.c')
-rw-r--r--src/basic/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/copy.c b/src/basic/copy.c
index 97d566c5b9..b384010ae3 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -15,6 +15,7 @@
#include "copy.h"
#include "dirent-util.h"
#include "fd-util.h"
+#include "fileio.h"
#include "fs-util.h"
#include "io-util.h"
#include "macro.h"
@@ -569,10 +570,9 @@ static int fd_copy_directory(
if (fdf < 0)
return -errno;
- d = fdopendir(fdf);
+ d = take_fdopendir(&fdf);
if (!d)
return -errno;
- fdf = -1;
exists = false;
if (copy_flags & COPY_MERGE_EMPTY) {