chiark / gitweb /
add basic (and not very useful) D-Bus support
[elogind.git] / job.c
diff --git a/job.c b/job.c
index 378a85df6708652bc6fc4e6dea9edc0ba7957aad..d02551aff443e5aa2135cd4cdbc1145f2b035b66 100644 (file)
--- a/job.c
+++ b/job.c
@@ -463,6 +463,17 @@ void job_schedule_run(Job *j) {
         j->in_run_queue = true;
 }
 
+char *job_dbus_path(Job *j) {
+        char *p;
+
+        assert(j);
+
+        if (asprintf(&p, "/org/freedesktop/systemd1/job/%lu", (unsigned long) j->id) < 0)
+                return NULL;
+
+        return p;
+}
+
 static const char* const job_state_table[_JOB_STATE_MAX] = {
         [JOB_WAITING] = "waiting",
         [JOB_RUNNING] = "running"