/* Note that this is called for all low-level state changes,
* even if they might map to the same high-level
* UnitActiveState! That means that ns == os is OK an expected
- * behaviour here. For example: if a mount point is remounted
+ * behavior here. For example: if a mount point is remounted
* this function will be called too! */
if (u->manager->n_reloading <= 0) {
if (u->instance)
return unit_name_path_unescape(u->instance);
- return unit_name_to_path(u->instance);
+ return unit_name_to_path(u->id);
}
static char *specifier_cgroup(char specifier, void *data, void *userdata) {
/* This is similar to unit_name_printf() but also supports
* unescaping. Also, adds a couple of additional codes:
*
+ * %f the the instance if set, otherwise the id
* %c cgroup path of unit
* %r root cgroup path of this systemd instance (e.g. "/user/lennart/shared/systemd-4711")
* %R parent of root cgroup path (e.g. "/usr/lennart/shared")
* %t the runtime directory to place sockets in (e.g. "/run" or $XDG_RUNTIME_DIR)
- * %u the username of the configured User or running user
- * %h the homedir of the configured User or running user
+ * %u the username of the configured user or running user
+ * %h the homedir of the configured user or running user
+ * %s the shell of the configured user or running user
*/
const Specifier table[] = {
{ 'P', specifier_prefix_unescaped, NULL },
{ 'i', specifier_string, u->instance },
{ 'I', specifier_instance_unescaped, NULL },
+
{ 'f', specifier_filename, NULL },
{ 'c', specifier_cgroup, NULL },
{ 'r', specifier_cgroup_root, NULL },
r = manager_load_unit(u->manager, e, NULL, NULL, &device);
free(e);
-
if (r < 0)
return r;
- if ((r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true)) < 0)
+ r = unit_add_two_dependencies(u, UNIT_AFTER, UNIT_BINDS_TO, device, true);
+ if (r < 0)
return r;
- if (wants)
- if ((r = unit_add_dependency(device, UNIT_WANTS, u, false)) < 0)
+ if (wants) {
+ r = unit_add_dependency(device, UNIT_WANTS, u, false);
+ if (r < 0)
return r;
+ }
return 0;
}