summaryrefslogtreecommitdiff
path: root/src/import/export-raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/export-raw.c')
-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;