- /* initialize the naming deamon */
- namedev_init();
-
- if (strcmp(action, "add") == 0)
- retval = udev_add_device(devpath, subsystem, 0);
-
- else if (strcmp(action, "remove") == 0)
- retval = udev_remove_device(devpath, subsystem);
+ /* trigger timout to interrupt blocking syscalls */
+ alarm(ALARM_TIMEOUT);
+
+ 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);