diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-02-02 12:42:08 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-02-02 12:42:08 +0100 |
commit | 86fbf370855aaa0c6e04d17bdd1d9d0c81bc5101 (patch) | |
tree | 6c49b24267232ed23ff344a2e1ff1369bfe21581 /manager.c | |
parent | 3813169516563114bf55d2198b3e01f10f197b9a (diff) |
dbus: install some properties on the job objects
Diffstat (limited to 'manager.c')
-rw-r--r-- | manager.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1257,3 +1257,26 @@ int manager_get_unit_from_dbus_path(Manager *m, const char *s, Unit **_u) { return 0; } + +int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j) { + Job *j; + unsigned id; + int r; + + assert(m); + assert(s); + assert(_j); + + if (!startswith(s, "/org/freedesktop/systemd1/job/")) + return -EINVAL; + + if ((r = safe_atou(s + 30, &id)) < 0) + return r; + + if (!(j = manager_get_job(m, id))) + return -ENOENT; + + *_j = j; + + return 0; +} |