summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-07-20 12:02:14 +0200
committerLennart Poettering <lennart@poettering.net>2018-07-23 13:38:18 +0200
commit0c462ea4ef6029b7974a052e44b6d1359a79953f (patch)
tree052160ef5889947498a7c87a773612f347ecb640 /src/import
parentef8becfac5f1d8e0cfce69afd3aadffb330efb70 (diff)
downloadsystemd-0c462ea4ef6029b7974a052e44b6d1359a79953f.tar.gz
tree-wide: port various bits over to open_parent()
Diffstat (limited to 'src/import')
-rw-r--r--src/import/export-raw.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/import/export-raw.c b/src/import/export-raw.c
index f97ae461c5..f3a34d40c5 100644
--- a/src/import/export-raw.c
+++ b/src/import/export-raw.c
@@ -16,6 +16,7 @@
#include "export-raw.h"
#include "fd-util.h"
#include "fileio.h"
+#include "fs-util.h"
#include "import-common.h"
#include "missing.h"
#include "ratelimit.h"
@@ -244,13 +245,9 @@ static int raw_export_on_defer(sd_event_source *s, void *userdata) {
}
static int reflink_snapshot(int fd, const char *path) {
- char *p, *d;
int new_fd, r;
- p = strdupa(path);
- d = dirname(p);
-
- new_fd = open(d, O_TMPFILE|O_CLOEXEC|O_NOCTTY|O_RDWR, 0600);
+ new_fd = open_parent(path, O_TMPFILE|O_CLOEXEC|O_RDWR, 0600);
if (new_fd < 0) {
_cleanup_free_ char *t = NULL;