chiark / gitweb /
[PATCH] update the man page to reflect the recent changes
[elogind.git] / udev_sysfs.c
index f0666509eaca5b87614d4124eb5a5e0d014ff4c5..f9ff1ed2f99c29f33905996b5e7f302991f45ee0 100644 (file)
@@ -105,7 +105,7 @@ static int wait_for_class_device_attributes(struct sysfs_class_device *class_dev
                                            const char **error)
 {
        const char *file;
-       char filename[SYSFS_PATH_MAX];
+       char filename[PATH_SIZE];
        int loop;
 
        file = get_subsystem_specific_file(class_dev->classname);
@@ -114,7 +114,8 @@ static int wait_for_class_device_attributes(struct sysfs_class_device *class_dev
                return 0;
        }
 
-       snprintf(filename, SYSFS_PATH_MAX-1, "%s/%s", class_dev->path, file);
+       snprintf(filename, sizeof(filename), "%s/%s", class_dev->path, file);
+       filename[sizeof(filename)-1] = '\0';
        dbg("looking at class '%s' for specific file '%s'", class_dev->classname, filename);
 
        loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
@@ -172,6 +173,7 @@ static int class_device_expect_no_device_link(struct sysfs_class_device *class_d
                { .subsystem = "input",         .device = "mice" },
                { .subsystem = "input",         .device = "mouse" },
                { .subsystem = "input",         .device = "ts" },
+               { .subsystem = "input",         .device = "js" },
                { .subsystem = "vc",            .device = NULL },
                { .subsystem = "tty",           .device = NULL },
                { .subsystem = "cpuid",         .device = "cpu" },
@@ -307,6 +309,7 @@ int wait_for_devices_device(struct sysfs_device *devices_dev,
                { .bus = "bttv-sub",    .file = NULL },
                { .bus = "pnp",         .file = "detach_state" },
                { .bus = "eisa",        .file = "detach_state" },
+               { .bus = "serio",       .file = "detach_state" },
                { .bus = "pseudo",      .file = "detach_state" },
                { .bus = "mmc",         .file = "detach_state" },
                { .bus = "macio",       .file = "detach_state" },
@@ -328,7 +331,7 @@ int wait_for_devices_device(struct sysfs_device *devices_dev,
                { .bus = "iucv",        .file = "detach_state" },
                { NULL, NULL }
        };
-       const struct device_file *devicefile;
+       const struct device_file *devicefile = NULL;
        int loop;
 
        /* the kernel may tell us what to wait for */
@@ -361,7 +364,7 @@ int wait_for_devices_device(struct sysfs_device *devices_dev,
 
                for (devicefile = device_files; devicefile->bus != NULL; devicefile++) {
                        if (strcmp(devices_dev->bus, devicefile->bus) == 0) {
-                               char filename[SYSFS_PATH_MAX];
+                               char filename[PATH_SIZE];
                                struct stat stats;
 
                                if (devicefile->file == NULL) {
@@ -370,7 +373,8 @@ int wait_for_devices_device(struct sysfs_device *devices_dev,
                                }
 
                                found_bus_type = 1;
-                               snprintf(filename, SYSFS_PATH_MAX-1, "%s/%s", devices_dev->path, devicefile->file);
+                               snprintf(filename, sizeof(filename), "%s/%s", devices_dev->path, devicefile->file);
+                               filename[sizeof(filename)-1] = '\0';
                                dbg("looking at bus '%s' device for specific file '%s'", devices_dev->bus, filename);
 
                                if (stat(filename, &stats) == 0) {