]> err.no Git - systemd/commitdiff
[PATCH] Don't use any syslog() in signal handler, cause it may deadlock.
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Fri, 5 Nov 2004 12:16:32 +0000 (13:16 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 05:09:26 +0000 (22:09 -0700)
udev.c
udev.h
udevd.c

diff --git a/udev.c b/udev.c
index cac60fd932bfcff1e3b72d2db1e6431fd73fba0e..78090605206f1fab763c4a1dccb21d485967940b 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -65,14 +65,10 @@ static void asmlinkage sig_handler(int signum)
        switch (signum) {
                case SIGALRM:
                        gotalarm = 1;
-                       info("error: timeout reached, event probably not handled correctly");
                        break;
                case SIGINT:
                case SIGTERM:
-                       udevdb_exit();
                        exit(20 + signum);
-               default:
-                       dbg("unhandled signal %d", signum);
        }
 }
 
@@ -148,6 +144,7 @@ int main(int argc, char *argv[], char *envp[])
        /* set signal handlers */
        act.sa_handler = (void (*) (int))sig_handler;
        sigemptyset (&act.sa_mask);
+       act.sa_flags = 0;
        /* alarm must not restart syscalls*/
        sigaction(SIGALRM, &act, NULL);
        sigaction(SIGINT, &act, NULL);
diff --git a/udev.h b/udev.h
index f7a13a634b77e75fff756248e0ca98df7579b0a2..e8954338d9f7e165b3f9f0a1fd34fa09865160ee 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -26,7 +26,7 @@
 #include <sys/param.h>
 #include "libsysfs/sysfs/libsysfs.h"
 
-#define ALARM_TIMEOUT                  30
+#define ALARM_TIMEOUT                  120
 #define COMMENT_CHARACTER              '#'
 
 #define NAME_SIZE                      256
diff --git a/udevd.c b/udevd.c
index 015083714389aaa65e2036a51b4216dc5cfa8bf6..395cdca88baba503e39488c116b587f7196a7025 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -327,20 +327,15 @@ static void asmlinkage sig_handler(int signum)
                        sigchilds_waiting = 1;
                        goto do_write;
                        break;
-               default:
-                       dbg("unhandled signal %d", signum);
-                       return;
        }
-       
+
 do_write:
        /* if pipe is empty, write to pipe to force select to return
         * immediately when it gets called
         */
        if (!sig_flag) {
                rc = write(pipefds[1],&signum,sizeof(signum));
-               if (rc < 0)
-                       dbg("unable to write to pipe");
-               else
+               if (rc >= 0)
                        sig_flag = 1;
        }
 }