diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-03-26 14:03:10 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-03-27 11:05:25 +0200 |
commit | 830e52caa2bf1a29f56cb93e7ed85acb1bda11c3 (patch) | |
tree | 9816d11fe5a8b0ce1212178ffab8e8db023797e2 /src/nspawn/nspawn.c | |
parent | 4e24df3cc32fdfd48db9184d138f0051e0dafbbe (diff) | |
download | systemd-830e52caa2bf1a29f56cb93e7ed85acb1bda11c3.tar.gz |
sd-id128: make id128_read() optionally take root directory
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r-- | src/nspawn/nspawn.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 9fbacb2713..982dffd1b8 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2828,7 +2828,6 @@ static int mount_tunnel_open(void) { } static int setup_machine_id(const char *directory) { - const char *etc_machine_id; sd_id128_t id; int r; @@ -2839,9 +2838,7 @@ static int setup_machine_id(const char *directory) { * in the container and our idea of the container UUID will always be in sync (at least if PID 1 in the * container behaves nicely). */ - etc_machine_id = prefix_roota(directory, "/etc/machine-id"); - - r = id128_read(etc_machine_id, ID128_FORMAT_PLAIN, &id); + r = id128_read(directory, "/etc/machine-id", ID128_FORMAT_PLAIN, &id); if (r < 0) { if (!ERRNO_IS_MACHINE_ID_UNSET(r)) /* If the file is missing, empty, or uninitialized, we don't mind */ return log_error_errno(r, "Failed to read machine ID from container image: %m"); |