diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-29 01:49:34 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-29 01:49:34 +0100 |
commit | 0ae97ec11506cce808232abd0979e20aed2fd625 (patch) | |
tree | ccadbc40292a7df0cf829f90398dec614edfd7f7 /unit.c | |
parent | 4fe88d28a4cfa504c1f2362d4a7030fae4c4af29 (diff) |
add api for choose the id name for a service
Diffstat (limited to 'unit.c')
-rw-r--r-- | unit.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -155,6 +155,21 @@ int unit_add_name(Unit *u, const char *text) { return 0; } +int unit_choose_id(Unit *u, const char *name) { + char *s; + + assert(u); + assert(name); + + /* Selects one of the names of this unit as the id */ + + if (!(s = set_get(u->meta.names, (char*) name))) + return -ENOENT; + + u->meta.id = s; + return 0; +} + void unit_add_to_load_queue(Unit *u) { assert(u); |