summaryrefslogtreecommitdiffstats
path: root/src/shared/blkid-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-12-01 15:37:59 +0100
committerLennart Poettering <lennart@poettering.net>2022-12-01 15:43:26 +0100
commit2e3944b872cf57dbccdda14ec66772e8fdd2273b (patch)
tree4f93b44ecaba93b414f01c833a567a00055761cf /src/shared/blkid-util.h
parenttree-wide: use errno_or_else() more, instead of homegrown checks (diff)
downloadsystemd-2e3944b872cf57dbccdda14ec66772e8fdd2273b.tar.xz
systemd-2e3944b872cf57dbccdda14ec66772e8fdd2273b.zip
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/blkid-util.h')
-rw-r--r--src/shared/blkid-util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/blkid-util.h b/src/shared/blkid-util.h
index d4e78627b8..abc4b6166d 100644
--- a/src/shared/blkid-util.h
+++ b/src/shared/blkid-util.h
@@ -34,4 +34,14 @@ static inline int blkid_partition_get_type_id128(blkid_partition p, sd_id128_t *
return sd_id128_from_string(s, ret);
}
+
+/* Define symbolic names for blkid_do_safeprobe() return values, since blkid only uses literal numbers. We
+ * prefix these symbolic definitions with underscores, to not invade libblkid's namespace needlessly. */
+enum {
+ _BLKID_SAFEPROBE_FOUND = 0,
+ _BLKID_SAFEPROBE_NOT_FOUND = 1,
+ _BLKID_SAFEPROBE_AMBIGUOUS = -2,
+ _BLKID_SAFEPROBE_ERROR = -1,
+};
+
#endif