chiark / gitweb /
gpt-auto-generator: skip nonexistent devices
[elogind.git] / src / gpt-auto-generator / gpt-auto-generator.c
index 25440e771ece5bfa90d2cd4d13c710ba9e9d6a87..e21ede94da819de3be25848145bed7887c350da7 100644 (file)
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/statfs.h>
-#include <blkid.h>
+#include <blkid/blkid.h>
 
 #ifdef HAVE_LINUX_BTRFS_H
 #include <linux/btrfs.h>
@@ -228,7 +228,6 @@ static int add_home(const char *path, const char *fstype) {
         if (!lnk)
                 return log_oom();
 
-
         mkdir_parents_label(lnk, 0755);
         if (symlink(unit, lnk) < 0) {
                 log_error("Failed to create symlink %s: %m", lnk);
@@ -298,6 +297,9 @@ 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)
+                                continue;
                         log_error("Failed to verify GPT partition %s: %s",
                                   node, strerror(-r));
                         return r;