server: Use para_sigaction() to install the temporary SIGCHLD handler.
authorAndre Noll <maan@systemlinux.org>
Mon, 6 Apr 2009 16:54:15 +0000 (18:54 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 6 Apr 2009 16:54:15 +0000 (18:54 +0200)
server.c

index 1e4caf0..c5c9761 100644 (file)
--- a/server.c
+++ b/server.c
@@ -485,7 +485,7 @@ static void server_init(int argc, char **argv)
                .check_ambiguity = 0,
                .print_errors = 1
        };
-       int afs_socket;
+       int ret, afs_socket;
 
        valid_fd_012();
        init_random_seed();
@@ -523,8 +523,9 @@ static void server_init(int argc, char **argv)
         * forked off. Otherwise, para_server does not notice if afs dies before
         * the SIGCHLD handler has been installed by init_signal_task() below.
         */
-       if (signal(SIGCHLD, tmp_sigchld_handler) == SIG_ERR) {
-               PARA_EMERG_LOG("failed to install temporary SIGCHLD handler\n");
+       ret = para_sigaction(SIGCHLD, tmp_sigchld_handler);
+       if (ret < 0) {
+               PARA_EMERG_LOG("SIGCHLD: %s\n", para_strerror(-ret));
                exit(EXIT_FAILURE);
        }
        PARA_NOTICE_LOG("initializing the audio file selector\n");