gpt-auto-generator: use EBADSLT code when unable to detect partition type
ENODEV suggests that something is missing, which is be misleading here.
This commit is contained in:
parent
843f737ade
commit
b948018034
|
@ -74,10 +74,8 @@ static int verify_gpt_partition(const char *node, sd_id128_t *type, unsigned *nr
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
r = blkid_do_safeprobe(b);
|
r = blkid_do_safeprobe(b);
|
||||||
if (r == -2)
|
if (r == -2 || r == 1) /* no result or uncertain */
|
||||||
return -ENODEV;
|
return -EBADSLT;
|
||||||
else if (r == 1)
|
|
||||||
return -ENODEV;
|
|
||||||
else if (r != 0)
|
else if (r != 0)
|
||||||
return errno ? -errno : -EIO;
|
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);
|
r = verify_gpt_partition(node, &type_id, &nr, &fstype);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
/* skip child devices which are not detected properly */
|
/* skip child devices which are not detected properly */
|
||||||
if (r == -ENODEV)
|
if (r == -EBADSLT)
|
||||||
continue;
|
continue;
|
||||||
log_error("Failed to verify GPT partition %s: %s",
|
log_error("Failed to verify GPT partition %s: %s",
|
||||||
node, strerror(-r));
|
node, strerror(-r));
|
||||||
|
|
Loading…
Reference in a new issue