summaryrefslogtreecommitdiff
path: root/src/boot/bootctl-install.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-02-01 12:08:25 +0100
committerLennart Poettering <lennart@poettering.net>2023-02-01 15:25:30 +0100
commit74e795ee5506821c3ee590f8ab0a968801422eba (patch)
tree8a4ff67dec34790ff22820ec2bd108902764e95e /src/boot/bootctl-install.c
parent19cfda9fc3c60de21a362ebb56bcb9f4a9855e85 (diff)
downloadsystemd-74e795ee5506821c3ee590f8ab0a968801422eba.tar.gz
id128: introduce ERRNO_IS_MACHINE_ID_UNSET() helper macro
Diffstat (limited to 'src/boot/bootctl-install.c')
-rw-r--r--src/boot/bootctl-install.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/boot/bootctl-install.c b/src/boot/bootctl-install.c
index 1dee592d77..c382d2a84f 100644
--- a/src/boot/bootctl-install.c
+++ b/src/boot/bootctl-install.c
@@ -6,30 +6,33 @@
#include "bootctl-util.h"
#include "chase-symlinks.h"
#include "copy.h"
+#include "dirent-util.h"
+#include "efi-api.h"
#include "env-file.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "glyph-util.h"
+#include "id128-util.h"
#include "os-util.h"
#include "path-util.h"
+#include "rm-rf.h"
#include "stat-util.h"
#include "sync-util.h"
#include "tmpfile-util.h"
#include "umask-util.h"
#include "utf8.h"
-#include "dirent-util.h"
-#include "efi-api.h"
-#include "rm-rf.h"
static int load_etc_machine_id(void) {
int r;
r = sd_id128_get_machine(&arg_machine_id);
- if (IN_SET(r, -ENOENT, -ENOMEDIUM, -ENOPKG)) /* Not set or empty */
- return 0;
- if (r < 0)
+ if (r < 0) {
+ if (ERRNO_IS_MACHINE_ID_UNSET(r)) /* Not set or empty */
+ return 0;
+
return log_error_errno(r, "Failed to get machine-id: %m");
+ }
log_debug("Loaded machine ID %s from /etc/machine-id.", SD_ID128_TO_STRING(arg_machine_id));
return 0;