chiark / gitweb /
[PATCH] fix debug in volume id / fix clashing global var name
[elogind.git] / wait_for_sysfs.c
index 37de02261d19627da27bd69c50de63323f58ad4e..45f84606b1774ef0716e3ef55e5f907cad15d4fe 100644 (file)
@@ -147,6 +147,7 @@ static int class_device_expect_no_device_link(struct sysfs_class_device *class_d
                { .subsystem = "block",         .device = "pf" },
                { .subsystem = "block",         .device = "scd" },
                { .subsystem = "block",         .device = "ubd" },
+               { .subsystem = "block",         .device = "dm-" },
                { .subsystem = "input",         .device = "event" },
                { .subsystem = "input",         .device = "mice" },
                { .subsystem = "input",         .device = "mouse" },
@@ -163,6 +164,7 @@ static int class_device_expect_no_device_link(struct sysfs_class_device *class_d
                { .subsystem = "net",           .device = "lo" },
                { .subsystem = "net",           .device = "tap" },
                { .subsystem = "net",           .device = "ipsec" },
+               { .subsystem = "net",           .device = "dummy" },
                { .subsystem = "net",           .device = "irda" },
                { .subsystem = "net",           .device = "ppp" },
                { .subsystem = "ppp",           .device = NULL },
@@ -385,7 +387,7 @@ int main(int argc, char *argv[], char *envp[])
        const char *devpath = "";
        const char *action;
        const char *subsystem;
-       char sysfs_path[SYSFS_PATH_MAX];
+       char sysfs_mnt_path[SYSFS_PATH_MAX];
        char filename[SYSFS_PATH_MAX];
        struct sysfs_class_device *class_dev;
        struct sysfs_device *devices_dev;
@@ -420,14 +422,14 @@ int main(int argc, char *argv[], char *envp[])
                goto exit;
        }
 
-       if (sysfs_get_mnt_path(sysfs_path, SYSFS_PATH_MAX) != 0) {
+       if (sysfs_get_mnt_path(sysfs_mnt_path, SYSFS_PATH_MAX) != 0) {
                dbg("error: no sysfs path");
                rc = 2;
                goto exit;
        }
 
        if ((strncmp(devpath, "/block/", 7) == 0) || (strncmp(devpath, "/class/", 7) == 0)) {
-               snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+               snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
                filename[SYSFS_PATH_MAX-1] = '\0';
 
                /* open the class device we are called for */
@@ -444,7 +446,7 @@ int main(int argc, char *argv[], char *envp[])
                sysfs_close_class_device(class_dev);
 
        } else if ((strncmp(devpath, "/devices/", 9) == 0)) {
-               snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+               snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
                filename[SYSFS_PATH_MAX-1] = '\0';
 
                /* open the path we are called for */