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/unit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core/unit.c') diff --git a/src/core/unit.c b/src/core/unit.c index 17c135cf3f..b44a2a5e2d 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -417,12 +417,11 @@ static void unit_remove_transient(Unit *u) { STRV_FOREACH(i, u->dropin_paths) { _cleanup_free_ char *p = NULL; - int r; (void) unlink(*i); - r = path_get_parent(*i, &p); - if (r >= 0) + p = dirname_malloc(*i); + if (p) (void) rmdir(p); } } -- cgit v1.2.3-54-g00ecf