]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
blockdev-util: change return value when a partition device is passed to partition_enu...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 18 Sep 2022 13:48:53 +0000 (22:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 18 Sep 2022 13:54:20 +0000 (22:54 +0900)
To make it consistent what returned by block_device_get_whole_disk().

src/shared/blockdev-util.c

index ff77a8e4ea80b9ebafd19119ed249fa39b3377d0..ab3b5ce263385b8a153cc474f85829d1c1e206bd 100644 (file)
@@ -572,7 +572,7 @@ int partition_enumerator_new(sd_device *dev, sd_device_enumerator **ret) {
         if (r < 0)
                 return r;
         if (r == 0)
-                return -EINVAL;
+                return -ENXIO; /* return a recognizable error */
 
         r = sd_device_enumerator_new(&e);
         if (r < 0)