summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-11 16:45:29 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-11 16:50:09 -0500
commitb94801803417c23d099cb7e508754181ecd27f9c (patch)
tree76f13c597f4d3c7565c512d1629a6e97181d7f4e
parent843f737ade9c73609a2280dd3dd16e18222a5dcb (diff)
downloadsystemd-b94801803417c23d099cb7e508754181ecd27f9c.tar.gz
gpt-auto-generator: use EBADSLT code when unable to detect partition type
ENODEV suggests that something is missing, which is be misleading here.
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index e21ede94da..05934da82f 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -74,10 +74,8 @@ static int verify_gpt_partition(const char *node, sd_id128_t *type, unsigned *nr
errno = 0;
r = blkid_do_safeprobe(b);
- if (r == -2)
- return -ENODEV;
- else if (r == 1)
- return -ENODEV;
+ if (r == -2 || r == 1) /* no result or uncertain */
+ return -EBADSLT;
else if (r != 0)
return errno ? -errno : -EIO;
@@ -298,7 +296,7 @@ static int enumerate_partitions(struct udev *udev, dev_t dev) {
r = verify_gpt_partition(node, &type_id, &nr, &fstype);
if (r < 0) {
/* skip child devices which are not detected properly */
- if (r == -ENODEV)
+ if (r == -EBADSLT)
continue;
log_error("Failed to verify GPT partition %s: %s",
node, strerror(-r));