From 5f311f8c0e51e2f13773823feb6a71f7c6f2838c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 26 Oct 2015 17:30:56 +0100 Subject: util: remove path_get_parent(), in favour of dirname_malloc() We don't need two functions that do essentialy the same, hence drop path_get_parent(), and stick to dirname_malloc(), but move it to path-util.[ch]. --- src/core/automount.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core/automount.c') 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); } -- cgit v1.2.3-54-g00ecf