diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-12-01 15:37:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-12-01 15:43:26 +0100 |
commit | 2e3944b872cf57dbccdda14ec66772e8fdd2273b (patch) | |
tree | 4f93b44ecaba93b414f01c833a567a00055761cf /src/shared/find-esp.c | |
parent | ef1f0a14fa2d933d0089fd7e52af21cc78a60493 (diff) | |
download | systemd-2e3944b872cf57dbccdda14ec66772e8fdd2273b.tar.gz |
blkid-util: define enum for blkid_do_safeprobe() return values
libblkid really should define an enum for this on its own, but it
currently doesn't and returns literal numeric values. Lets make this
more readable by adding our own symbolic names via an enum.
Diffstat (limited to 'src/shared/find-esp.c')
-rw-r--r-- | src/shared/find-esp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/find-esp.c b/src/shared/find-esp.c index 80d27b5736..e019b81620 100644 --- a/src/shared/find-esp.c +++ b/src/shared/find-esp.c @@ -571,12 +571,14 @@ static int verify_xbootldr_blkid( errno = 0; r = blkid_do_safeprobe(b); - if (r == -2) + if (r == _BLKID_SAFEPROBE_AMBIGUOUS) return log_error_errno(SYNTHETIC_ERRNO(ENODEV), "%s: File system is ambiguous.", node); - else if (r == 1) + if (r == _BLKID_SAFEPROBE_NOT_FOUND) return log_error_errno(SYNTHETIC_ERRNO(ENODEV), "%s: File system does not contain a label.", node); - else if (r != 0) - return log_error_errno(errno ?: SYNTHETIC_ERRNO(EIO), "%s: Failed to probe file system: %m", node); + if (r == _BLKID_SAFEPROBE_ERROR) + return log_error_errno(errno_or_else(EIO), "%s: Failed to probe file system: %m", node); + + assert(r == _BLKID_SAFEPROBE_FOUND); r = blkid_probe_lookup_value(b, "PART_ENTRY_SCHEME", &type, NULL); if (r != 0) |