summaryrefslogtreecommitdiff
path: root/src/core/automount.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/automount.c')
-rw-r--r--src/core/automount.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 2ee32312fb..df98711d96 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -141,13 +141,12 @@ static void automount_done(Unit *u) {
static int automount_add_mount_links(Automount *a) {
_cleanup_free_ char *parent = NULL;
- int r;
assert(a);
- r = path_get_parent(a->where, &parent);
- if (r < 0)
- return r;
+ parent = dirname_malloc(a->where);
+ if (!parent)
+ return -ENOMEM;
return unit_require_mounts_for(UNIT(a), parent);
}