- signal(SIGINT, sig_handler);
- signal(SIGTERM, sig_handler);
-
- /* initialize the naming deamon */
- namedev_init();
-
- if (strcmp(action, "add") == 0)
- retval = udev_add_device(devpath, subsystem);
-
- else if (strcmp(action, "remove") == 0)
- retval = udev_remove_device(devpath, subsystem);
-
- else {
- dbg("unknown action '%s'", action);
- retval = -EINVAL;
+ act.sa_handler = sig_handler;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);
+
+ if (strcmp(action, "add") == 0) {
+ namedev_init();
+ retval = udev_add_device(devpath, subsystem, 0);
+ } else {
+ if (strcmp(action, "remove") == 0) {
+ retval = udev_remove_device(devpath, subsystem);
+ } else {
+ dbg("unknown action '%s'", action);
+ retval = -EINVAL;
+ }