summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-03 20:34:04 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-03 23:58:25 +0100
commit59e73c5b102402ea18aec1f4d69b4daad574e82b (patch)
tree56b6b059b6b97516f3df4d2ef913d35c5d23c54f /src
parent2b26a72816aac6d28f44460ffe28882f006489c8 (diff)
gpt-auto: handle errors from blkid more correctly
Let's make sure we don't choke if blkid_probe_lookup_value() returns a NULL string. Also, make sur we propagate the correct error when blkid_probe_lookup_value() fails.
Diffstat (limited to 'src')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index a1bad9fcbe..9086ca5dd7 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -515,14 +515,15 @@ static int add_boot(const char *what) {
return log_error_errno(errno ?: EIO, "Failed to probe %s: %m", what);
(void) blkid_probe_lookup_value(b, "TYPE", &fstype, NULL);
- if (!streq(fstype, "vfat")) {
+ if (!streq_ptr(fstype, "vfat")) {
log_debug("Partition for /boot is not a FAT filesystem, ignoring.");
return 0;
}
+ errno = 0;
r = blkid_probe_lookup_value(b, "PART_ENTRY_UUID", &uuid, NULL);
if (r != 0) {
- log_debug_errno(r, "Partition for /boot does not have a UUID, ignoring. %m");
+ log_debug_errno(errno, "Partition for /boot does not have a UUID, ignoring.");
return 0;
}