chiark / gitweb /
path-util: there is no function path_parent()
[elogind.git] / src / core / manager.c
index a6013668b8a8221997cf92cda3f3430e506f4758..c6baf22ae510bb2401458082de18e5f84c8ce550 100644 (file)
@@ -65,6 +65,7 @@
 #include "virt.h"
 #include "watchdog.h"
 #include "cgroup-util.h"
+#include "path-util.h"
 
 /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */
 #define GC_QUEUE_ENTRIES_MAX 16
@@ -678,6 +679,8 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
 
         log_debug("Trying to enqueue job %s/%s/%s", unit->id, job_type_to_string(type), job_mode_to_string(mode));
 
+        job_type_collapse(&type, unit);
+
         tr = transaction_new();
         if (!tr)
                 return -ENOMEM;
@@ -783,7 +786,7 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DB
         }
 
         if (!name)
-                name = file_name_from_path(path);
+                name = path_get_file_name(path);
 
         t = unit_name_to_type(name);