+ switch (signum) {
+ case SIGALRM:
+ exit(1);
+ case SIGINT:
+ case SIGTERM:
+ exit(20 + signum);
+ }
+}
+
+int main(int argc, char *argv[], char *envp[])
+{
+ struct sigaction act;
+
+ udev_init_config();
+
+ /* 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);
+
+ /* trigger timeout to prevent hanging processes */
+ alarm(ALARM_TIMEOUT);
+
+ /* set environment for executed programs */
+ setenv("ACTION", "add", 1);
+ setenv("UDEV_START", "1", 1);
+
+ namedev_init();
+