diff options
Diffstat (limited to 'src/shared/cgroup-util.c')
-rw-r--r-- | src/shared/cgroup-util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index 5d44342bbe..e54b94658c 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -1320,7 +1320,7 @@ int cg_pid_get_user_unit(pid_t pid, char **unit) { int cg_path_get_machine_name(const char *path, char **machine) { const char *e, *n; - char *s; + char *s, *dot; assert(path); assert(machine); @@ -1337,6 +1337,10 @@ int cg_path_get_machine_name(const char *path, char **machine) { if (!s) return -ENOMEM; + dot = strrchr(s, '.'); + if (dot) + *dot = 0; + *machine = s; return 0; } |