summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 572b1c1b78..8d56401231 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -28,6 +28,7 @@
#include "sd-id128.h"
#include "sd-messages.h"
+#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-util.h"
#include "cgroup-util.h"
@@ -44,10 +45,12 @@
#include "macro.h"
#include "missing.h"
#include "mkdir.h"
+#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "set.h"
#include "special.h"
+#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
@@ -416,12 +419,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);
}
}