sd-id128: make id128_read() optionally take root directory

This commit is contained in:
Yu Watanabe
2023-03-27 11:05:25 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 4e24df3cc3
commit 830e52caa2
5 changed files with 13 additions and 16 deletions
+1 -4
View File
@@ -158,14 +158,11 @@ static int run(int argc, char *argv[]) {
}
if (arg_commit) {
const char *etc_machine_id;
r = machine_id_commit(arg_root);
if (r < 0)
return r;
etc_machine_id = prefix_roota(arg_root, "/etc/machine-id");
r = id128_read(etc_machine_id, ID128_FORMAT_PLAIN, &id);
r = id128_read(arg_root, "/etc/machine-id", ID128_FORMAT_PLAIN, &id);
if (r < 0)
return log_error_errno(r, "Failed to read machine ID back: %m");
} else {