- if (strcmp(action, "add") == 0)
- retval = udev_add_device(devpath, subsystem, 0);
+ /* initialize udev database */
+ if (udevdb_init(UDEVDB_DEFAULT) != 0)
+ info("error: unable to initialize database, continuing without database");
+
+ switch(act_type) {
+ case UDEVSTART:
+ dbg("udevstart");
+ namedev_init();
+ retval = udev_start();
+ break;
+ case ADD:
+ dbg("udev add");
+
+ /* open the device */
+ snprintf(path, SYSFS_PATH_MAX, "%s%s", sysfs_path, udev.devpath);
+ class_dev = sysfs_open_class_device_path(path);
+ if (class_dev == NULL) {
+ dbg ("sysfs_open_class_device_path failed");
+ break;
+ }
+ dbg("opened class_dev->name='%s'", class_dev->name);