summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/home/homework-luks.c10
-rw-r--r--src/shared/find-esp.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c
index 3d3369f299..b562cb5e92 100644
--- a/src/home/homework-luks.c
+++ b/src/home/homework-luks.c
@@ -141,7 +141,7 @@ static int probe_file_system_by_fd(
errno = 0;
r = blkid_probe_set_device(b, fd, 0, 0);
if (r != 0)
- return errno > 0 ? -errno : -ENOMEM;
+ return errno_or_else(ENOMEM);
(void) blkid_probe_enable_superblocks(b, 1);
(void) blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE|BLKID_SUBLKS_UUID);
@@ -656,7 +656,7 @@ static int luks_validate(
errno = 0;
r = blkid_probe_set_device(b, fd, 0, 0);
if (r != 0)
- return errno > 0 ? -errno : -ENOMEM;
+ return errno_or_else(ENOMEM);
(void) blkid_probe_enable_superblocks(b, 1);
(void) blkid_probe_set_superblocks_flags(b, BLKID_SUBLKS_TYPE);
@@ -687,12 +687,12 @@ static int luks_validate(
errno = 0;
pl = blkid_probe_get_partitions(b);
if (!pl)
- return errno > 0 ? -errno : -ENOMEM;
+ return errno_or_else(ENOMEM);
errno = 0;
n = blkid_partlist_numof_partitions(pl);
if (n < 0)
- return errno > 0 ? -errno : -EIO;
+ return errno_or_else(EIO);
for (int i = 0; i < n; i++) {
sd_id128_t id = SD_ID128_NULL;
@@ -701,7 +701,7 @@ static int luks_validate(
errno = 0;
pp = blkid_partlist_get_partition(pl, i);
if (!pp)
- return errno > 0 ? -errno : -EIO;
+ return errno_or_else(EIO);
if (sd_id128_string_equal(blkid_partition_get_type_string(pp), SD_GPT_USER_HOME) <= 0)
continue;
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),