- etc_machine_id = strappenda(root, "/etc/machine-id");
- path_kill_slashes(etc_machine_id);
+ if (isempty(root)) {
+ etc_machine_id = "/etc/machine-id";
+ run_machine_id = "/run/machine-id";
+ } else {
+ etc_machine_id = strappenda(root, "/etc/machine-id");
+ path_kill_slashes((char*) etc_machine_id);