+ /* set signal handlers */
+ act.sa_handler = (void (*) (int))sig_handler;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ /* alarm must not restart syscalls*/
+ sigaction(SIGALRM, &act, NULL);
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);
+
+ /* trigger timout to interrupt blocking syscalls */
+ alarm(ALARM_TIMEOUT);
+
+ switch(act_type) {
+ case UDEVSTART:
+ dbg("udevstart");
+ udev_log = 0;
+ 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);