summaryrefslogtreecommitdiffstats
path: root/src/shared/find-esp.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-12-01 15:36:55 +0100
committerLennart Poettering <lennart@poettering.net>2022-12-01 15:42:46 +0100
commitef1f0a14fa2d933d0089fd7e52af21cc78a60493 (patch)
treeef174f0ad3c9c15f5bf1811d934abbe8a83fdd73 /src/shared/find-esp.c
parentMerge pull request #25579 from DaanDeMeyer/copy-graceful-symlinks (diff)
downloadsystemd-ef1f0a14fa2d933d0089fd7e52af21cc78a60493.tar.xz
systemd-ef1f0a14fa2d933d0089fd7e52af21cc78a60493.zip
tree-wide: use errno_or_else() more, instead of homegrown checks
Diffstat (limited to 'src/shared/find-esp.c')
-rw-r--r--src/shared/find-esp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/find-esp.c b/src/shared/find-esp.c
index fa234c8b5f..80d27b5736 100644
--- a/src/shared/find-esp.c
+++ b/src/shared/find-esp.c
@@ -564,7 +564,7 @@ static int verify_xbootldr_blkid(
errno = 0;
b = blkid_new_probe_from_filename(node);
if (!b)
- return log_error_errno(errno ?: SYNTHETIC_ERRNO(ENOMEM), "%s: Failed to create blkid probe: %m", node);
+ return log_error_errno(errno_or_else(ENOMEM), "%s: Failed to create blkid probe: %m", node);
blkid_probe_enable_partitions(b, 1);
blkid_probe_set_partitions_flags(b, BLKID_PARTS_ENTRY_DETAILS);
@@ -588,7 +588,7 @@ static int verify_xbootldr_blkid(
errno = 0;
r = blkid_probe_lookup_value(b, "PART_ENTRY_TYPE", &v, NULL);
if (r != 0)
- return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "%s: Failed to probe PART_ENTRY_TYPE: %m", node);
+ return log_error_errno(errno_or_else(EIO), "%s: Failed to probe PART_ENTRY_TYPE: %m", node);
if (sd_id128_string_equal(v, SD_GPT_XBOOTLDR) <= 0)
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
searching ? SYNTHETIC_ERRNO(EADDRNOTAVAIL) : SYNTHETIC_ERRNO(ENODEV),
@@ -597,7 +597,7 @@ static int verify_xbootldr_blkid(
errno = 0;
r = blkid_probe_lookup_value(b, "PART_ENTRY_UUID", &v, NULL);
if (r != 0)
- return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "%s: Failed to probe PART_ENTRY_UUID: %m", node);
+ return log_error_errno(errno_or_else(EIO), "%s: Failed to probe PART_ENTRY_UUID: %m", node);
r = sd_id128_from_string(v, &uuid);
if (r < 0)
return log_error_errno(r, "%s: Partition has invalid UUID PART_ENTRY_TYPE=%s: %m", node, v);
@@ -607,7 +607,7 @@ static int verify_xbootldr_blkid(
errno = 0;
r = blkid_probe_lookup_value(b, "PART_ENTRY_TYPE", &v, NULL);
if (r != 0)
- return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "%s: Failed to probe PART_ENTRY_TYPE: %m", node);
+ return log_error_errno(errno_or_else(EIO), "%s: Failed to probe PART_ENTRY_TYPE: %m", node);
if (!streq(v, "0xea"))
return log_full_errno(searching ? LOG_DEBUG : LOG_ERR,
searching ? SYNTHETIC_ERRNO(EADDRNOTAVAIL) : SYNTHETIC_ERRNO(ENODEV),