diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-02-01 12:08:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-02-01 15:25:30 +0100 |
commit | 74e795ee5506821c3ee590f8ab0a968801422eba (patch) | |
tree | 8a4ff67dec34790ff22820ec2bd108902764e95e /src/partition | |
parent | 19cfda9fc3c60de21a362ebb56bcb9f4a9855e85 (diff) | |
download | systemd-74e795ee5506821c3ee590f8ab0a968801422eba.tar.gz |
id128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macro
Diffstat (limited to 'src/partition')
-rw-r--r-- | src/partition/repart.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c index 920b442316..73712a36eb 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -4789,10 +4789,12 @@ static int context_read_seed(Context *context, const char *root) { return log_error_errno(fd, "Failed to determine machine ID of image: %m"); else { r = id128_read_fd(fd, ID128_FORMAT_PLAIN, &context->seed); - if (IN_SET(r, -ENOMEDIUM, -ENOPKG)) + if (r < 0) { + if (!ERRNO_IS_MACHINE_ID_UNSET(r)) + return log_error_errno(r, "Failed to parse machine ID of image: %m"); + log_info("No machine ID set, using randomized partition UUIDs."); - else if (r < 0) - return log_error_errno(r, "Failed to parse machine ID of image: %m"); + } return 0; } |