+ switch (signum) {
+ case SIGALRM:
+ exit(1);
+ case SIGINT:
+ case SIGTERM:
+ exit(20 + signum);
+ }
+}
+
+int main(int argc, char *argv[], char *envp[])
+{
+ struct sigaction act;
+
+ logging_init("udev");
+ udev_init_config();
+ /* disable all logging if not explicitely requested */
+ if (getenv("UDEV_LOG") == NULL)
+ udev_log_priority = 0;
+ dbg("version %s", UDEV_VERSION);
+
+ /* 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 */