diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-02 23:30:19 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-02 23:32:34 +0100 |
commit | e821075a23fdfa3ca7738fc30bb2d4c430fe10c0 (patch) | |
tree | 37f970d8139c7796dda5ef0a295ee121ceabf349 /src/shared/unit-name.c | |
parent | f9638db8de2f915a5c5f6e4b7292494168eb4141 (diff) |
bus: add .busname unit type to implement kdbus-style bus activation
Diffstat (limited to 'src/shared/unit-name.c')
-rw-r--r-- | src/shared/unit-name.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c index 2335463777..178efefdbf 100644 --- a/src/shared/unit-name.c +++ b/src/shared/unit-name.c @@ -36,13 +36,14 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = { [UNIT_SERVICE] = "service", [UNIT_SOCKET] = "socket", + [UNIT_BUSNAME] = "busname", [UNIT_TARGET] = "target", + [UNIT_SNAPSHOT] = "snapshot", [UNIT_DEVICE] = "device", [UNIT_MOUNT] = "mount", [UNIT_AUTOMOUNT] = "automount", - [UNIT_SNAPSHOT] = "snapshot", - [UNIT_TIMER] = "timer", [UNIT_SWAP] = "swap", + [UNIT_TIMER] = "timer", [UNIT_PATH] = "path", [UNIT_SLICE] = "slice", [UNIT_SCOPE] = "scope" @@ -441,7 +442,7 @@ char *unit_name_from_path_instance(const char *prefix, const char *path, const c } char *unit_name_to_path(const char *name) { - char *w, *e; + _cleanup_free_ char *w = NULL; assert(name); @@ -449,10 +450,7 @@ char *unit_name_to_path(const char *name) { if (!w) return NULL; - e = unit_name_path_unescape(w); - free(w); - - return e; + return unit_name_path_unescape(w); } char *unit_dbus_path_from_name(const char *name) { |