- if (strstr(argv[0], "udevstart")) {
- act_type = UDEVSTART;
- } else {
- action = get_action();
- if (!action) {
- dbg("no action?");
- goto exit;
- }
- if (strcmp(action, "add") == 0) {
- act_type = ADD;
- } else if (strcmp(action, "remove") == 0) {
- act_type = REMOVE;
- } else {
- dbg("unknown action '%s'", action);
- goto exit;
- }
+ /* set signal handlers */
+ memset(&act, 0x00, sizeof(act));
+ act.sa_handler = (void (*)(int)) sig_handler;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ sigaction(SIGALRM, &act, NULL);
+ sigaction(SIGINT, &act, NULL);
+ sigaction(SIGTERM, &act, NULL);