chiark / gitweb /
[PATCH] compile udevd with klibc
[elogind.git] / udev.c
diff --git a/udev.c b/udev.c
index b45fb336be8c631023b891a7a60b3840433a6f07..0f01fa41d2a04e6b08cda306c7d61d6345c146de 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -40,16 +40,19 @@ char **main_argv;
 char **main_envp;
 unsigned char logname[42];
 
+int log_ok(void)
+{
+       return udev_log;
+}
+
 static void sig_handler(int signum)
 {
-       dbg("caught signal %d", signum);
        switch (signum) {
                case SIGINT:
                case SIGTERM:
                        sysbus_disconnect();
                        udevdb_exit();
                        exit(20 + signum);
-                       break;
                default:
                        dbg("unhandled signal");
        }
@@ -95,6 +98,7 @@ static int udev_hotplug(int argc, char **argv)
        char *subsystem;
        int retval = -EINVAL;
        int i;
+       struct sigaction act;
 
        action = get_action();
        if (!action) {
@@ -141,8 +145,11 @@ static int udev_hotplug(int argc, char **argv)
        }
 
        /* set up a default signal handler for now */
-       signal(SIGINT, sig_handler);
-       signal(SIGTERM, sig_handler);
+       act.sa_handler = sig_handler;
+       sigemptyset (&act.sa_mask);
+       act.sa_flags = SA_RESTART;
+       sigaction(SIGINT, &act, NULL);
+       sigaction(SIGTERM, &act, NULL);
 
        /* initialize the naming deamon */
        namedev_init();