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

This reverts commit 830e52caa2.
This commit is contained in:
Yu Watanabe
2023-04-04 11:46:18 +09:00
parent de2820606d
commit 17f9d6d806
5 changed files with 16 additions and 13 deletions
+4 -1
View File
@@ -2828,6 +2828,7 @@ 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;
@@ -2838,7 +2839,9 @@ 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). */
r = id128_read(directory, "/etc/machine-id", ID128_FORMAT_PLAIN, &id);
etc_machine_id = prefix_roota(directory, "/etc/machine-id");
r = id128_read(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");