]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine-id-setup: use id128_get_machine() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 1 Apr 2023 13:49:47 +0000 (22:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 4 Apr 2023 15:52:56 +0000 (00:52 +0900)
src/machine-id-setup/machine-id-setup-main.c

index 5620bf9bafc750da7c1b8bd155548a846a94fac0..223164ea1bd25510ae147f5680962802c48c203a 100644 (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_get_machine(arg_root, &id);
                 if (r < 0)
                         return log_error_errno(r, "Failed to read machine ID back: %m");
         } else {