]> granicus.if.org Git - apache/commitdiff
stop relying on a macro to map signal() to ap_signal(); call
authorJeff Trawick <trawick@apache.org>
Wed, 5 Apr 2000 01:23:51 +0000 (01:23 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 5 Apr 2000 01:23:51 +0000 (01:23 +0000)
ap_signal() directly

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84914 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c
server/log.c
server/mpm/dexter/dexter.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c

index 8c848612360e47b19440d7b9425e046f6d446e5e..155aedcc0fb8fc908387eda12efd599db249e0ae 100644 (file)
@@ -855,7 +855,7 @@ static int read_request_line(request_rec *r)
      * thread isn't used. - mvsk
 
 #ifdef SIGWINCH
-    signal(SIGWINCH, SIG_IGN);
+    ap_signal(SIGWINCH, SIG_IGN);
 #endif
     */
 
index a6c857bce63e09e644abfc68fd1c5dea040d3ca7..c67036628dc07e50ee6cfad47659eddc1b0882e0 100644 (file)
@@ -175,7 +175,7 @@ static int log_child(ap_context_t *p, const char *progname,
 
 #ifdef SIGHUP
     /* No concept of a child process on Win32 */
-    signal(SIGHUP, SIG_IGN);
+    ap_signal(SIGHUP, SIG_IGN);
 #endif /* ndef SIGHUP */
 
     if ((ap_createprocattr_init(&procattr, p) != APR_SUCCESS) ||
@@ -585,7 +585,7 @@ static int piped_log_spawn(piped_log *pl)
 
     ap_cleanup_for_exec();
 #ifdef SIGHUP
-    signal(SIGHUP, SIG_IGN);
+    ap_signal(SIGHUP, SIG_IGN);
 #endif
     if ((ap_createprocattr_init(&procattr, pl->p)         != APR_SUCCESS) ||
         (ap_setprocattr_dir(procattr, pl->program)        != APR_SUCCESS) ||
index 02263a2146e16fc1f1ba7eda4b16aba1b0aec4b8..b75c514df7de413f5bcd937135d5feab63bc9fc5 100644 (file)
@@ -304,7 +304,7 @@ static int wait_or_timeout(ap_wait_t *status)
 static void sig_coredump(int sig)
 {
     chdir(ap_coredump_dir);
-    signal(sig, SIG_DFL);
+    ap_signal(sig, SIG_DFL);
     kill(getpid(), sig);
     /* At this point we've got sig blocked, because we're still inside
      * the signal handler.  When we leave the signal handler it will
@@ -454,36 +454,36 @@ static void set_signals(void)
        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "sigaction(SIGWINCH)");
 #else
     if (!one_process) {
-       signal(SIGSEGV, sig_coredump);
+       ap_signal(SIGSEGV, sig_coredump);
 #ifdef SIGBUS
-       signal(SIGBUS, sig_coredump);
+       ap_signal(SIGBUS, sig_coredump);
 #endif /* SIGBUS */
 #ifdef SIGABORT
-       signal(SIGABORT, sig_coredump);
+       ap_signal(SIGABORT, sig_coredump);
 #endif /* SIGABORT */
 #ifdef SIGABRT
-       signal(SIGABRT, sig_coredump);
+       ap_signal(SIGABRT, sig_coredump);
 #endif /* SIGABRT */
 #ifdef SIGILL
-       signal(SIGILL, sig_coredump);
+       ap_signal(SIGILL, sig_coredump);
 #endif /* SIGILL */
 #ifdef SIGXCPU
-       signal(SIGXCPU, SIG_DFL);
+       ap_signal(SIGXCPU, SIG_DFL);
 #endif /* SIGXCPU */
 #ifdef SIGXFSZ
-       signal(SIGXFSZ, SIG_DFL);
+       ap_signal(SIGXFSZ, SIG_DFL);
 #endif /* SIGXFSZ */
     }
 
-    signal(SIGTERM, sig_term);
+    ap_signal(SIGTERM, sig_term);
 #ifdef SIGHUP
-    signal(SIGHUP, restart);
+    ap_signal(SIGHUP, restart);
 #endif /* SIGHUP */
 #ifdef SIGWINCH
-    signal(SIGWINCH, restart);
+    ap_signal(SIGWINCH, restart);
 #endif /* SIGWINCH */
 #ifdef SIGPIPE
-    signal(SIGPIPE, SIG_IGN);
+    ap_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
 
 #endif
@@ -983,7 +983,7 @@ static int make_child(server_rec *s, int slot, time_t now)
         RAISE_SIGSTOP(MAKE_CHILD);
 
        /* XXX - For an unthreaded server, a signal handler will be necessary
-        signal(SIGTERM, just_die);
+        ap_signal(SIGTERM, just_die);
        */
         child_main(slot);
 
@@ -1269,7 +1269,7 @@ int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
     }
 
     /* we've been told to restart */
-    signal(SIGHUP, SIG_IGN);
+    ap_signal(SIGHUP, SIG_IGN);
 
     if (one_process) {
        /* not worth thinking about */
index 83e73108ce90ba9b103632286277621213ada455..0dac56a45f121d8486c1559d9914d30f01e72712 100644 (file)
@@ -298,7 +298,7 @@ static int wait_or_timeout(ap_wait_t *status)
 static void sig_coredump(int sig)
 {
     chdir(ap_coredump_dir);
-    signal(sig, SIG_DFL);
+    ap_signal(sig, SIG_DFL);
     kill(my_pid, sig);
     /* At this point we've got sig blocked, because we're still inside
      * the signal handler.  When we leave the signal handler it will
@@ -449,36 +449,36 @@ static void set_signals(void)
        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "sigaction(SIGWINCH)");
 #else
     if (!one_process) {
-       signal(SIGSEGV, sig_coredump);
+       ap_signal(SIGSEGV, sig_coredump);
 #ifdef SIGBUS
-       signal(SIGBUS, sig_coredump);
+       ap_signal(SIGBUS, sig_coredump);
 #endif /* SIGBUS */
 #ifdef SIGABORT
-       signal(SIGABORT, sig_coredump);
+       ap_signal(SIGABORT, sig_coredump);
 #endif /* SIGABORT */
 #ifdef SIGABRT
-       signal(SIGABRT, sig_coredump);
+       ap_signal(SIGABRT, sig_coredump);
 #endif /* SIGABRT */
 #ifdef SIGILL
-       signal(SIGILL, sig_coredump);
+       ap_signal(SIGILL, sig_coredump);
 #endif /* SIGILL */
 #ifdef SIGXCPU
-       signal(SIGXCPU, SIG_DFL);
+       ap_signal(SIGXCPU, SIG_DFL);
 #endif /* SIGXCPU */
 #ifdef SIGXFSZ
-       signal(SIGXFSZ, SIG_DFL);
+       ap_signal(SIGXFSZ, SIG_DFL);
 #endif /* SIGXFSZ */
     }
 
-    signal(SIGTERM, sig_term);
+    ap_signal(SIGTERM, sig_term);
 #ifdef SIGHUP
-    signal(SIGHUP, restart);
+    ap_signal(SIGHUP, restart);
 #endif /* SIGHUP */
 #ifdef SIGWINCH
-    signal(SIGWINCH, restart);
+    ap_signal(SIGWINCH, restart);
 #endif /* SIGWINCH */
 #ifdef SIGPIPE
-    signal(SIGPIPE, SIG_IGN);
+    ap_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
 
 #endif
@@ -952,7 +952,7 @@ static int make_child(server_rec *s, int slot, time_t now)
 
         RAISE_SIGSTOP(MAKE_CHILD);
 
-        signal(SIGTERM, just_die);
+        ap_signal(SIGTERM, just_die);
         child_main(slot);
 
        return 0;
@@ -1279,7 +1279,7 @@ int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
     }
 
     /* we've been told to restart */
-    signal(SIGHUP, SIG_IGN);
+    ap_signal(SIGHUP, SIG_IGN);
 
     if (one_process) {
        /* not worth thinking about */
index 91f0a1e5f8c85ac27405c92c430ea86904fdfd8f..4bf053b70ae512ef79ca1b33e9edb5ec3cac4bcd 100644 (file)
@@ -1182,7 +1182,7 @@ static int wait_or_timeout(ap_wait_t *status)
 static void sig_coredump(int sig)
 {
     chdir(ap_coredump_dir);
-    signal(sig, SIG_DFL);
+    ap_signal(sig, SIG_DFL);
     kill(getpid(), sig);
     /* At this point we've got sig blocked, because we're still inside
      * the signal handler.  When we leave the signal handler it will
@@ -1311,36 +1311,36 @@ static void set_signals(void)
        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, "sigaction(SIGUSR1)");
 #else
     if (!one_process) {
-       signal(SIGSEGV, sig_coredump);
+       ap_signal(SIGSEGV, sig_coredump);
 #ifdef SIGBUS
-       signal(SIGBUS, sig_coredump);
+       ap_signal(SIGBUS, sig_coredump);
 #endif /* SIGBUS */
 #ifdef SIGABORT
-       signal(SIGABORT, sig_coredump);
+       ap_signal(SIGABORT, sig_coredump);
 #endif /* SIGABORT */
 #ifdef SIGABRT
-       signal(SIGABRT, sig_coredump);
+       ap_signal(SIGABRT, sig_coredump);
 #endif /* SIGABRT */
 #ifdef SIGILL
-       signal(SIGILL, sig_coredump);
+       ap_signal(SIGILL, sig_coredump);
 #endif /* SIGILL */
 #ifdef SIGXCPU
-       signal(SIGXCPU, SIG_DFL);
+       ap_signal(SIGXCPU, SIG_DFL);
 #endif /* SIGXCPU */
 #ifdef SIGXFSZ
-       signal(SIGXFSZ, SIG_DFL);
+       ap_signal(SIGXFSZ, SIG_DFL);
 #endif /* SIGXFSZ */
     }
 
-    signal(SIGTERM, sig_term);
+    ap_signal(SIGTERM, sig_term);
 #ifdef SIGHUP
-    signal(SIGHUP, restart);
+    ap_signal(SIGHUP, restart);
 #endif /* SIGHUP */
 #ifdef SIGUSR1
-    signal(SIGUSR1, restart);
+    ap_signal(SIGUSR1, restart);
 #endif /* SIGUSR1 */
 #ifdef SIGPIPE
-    signal(SIGPIPE, SIG_IGN);
+    ap_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
 
 #endif
@@ -1436,8 +1436,8 @@ static void child_main(int child_num_arg)
 
     (void) ap_update_child_status(my_child_num, SERVER_READY, (request_rec *) NULL);
 
-    signal(SIGHUP, just_die);
-    signal(SIGTERM, just_die);
+    ap_signal(SIGHUP, just_die);
+    ap_signal(SIGTERM, just_die);
 
 #ifdef OS2
 /* Stop Ctrl-C/Ctrl-Break signals going to child processes */
@@ -1454,7 +1454,7 @@ static void child_main(int child_num_arg)
         * we can exit cleanly.
         */
        usr1_just_die = 1;
-       signal(SIGUSR1, usr1_handler);
+       ap_signal(SIGUSR1, usr1_handler);
 
        /*
         * (Re)initialize this child to a pre-connection state.
@@ -1662,7 +1662,7 @@ static void child_main(int child_num_arg)
         * the signal to ignore because we don't want to disturb any
         * third party code.
         */
-       signal(SIGUSR1, SIG_IGN);
+       ap_signal(SIGUSR1, SIG_IGN);
        /*
         * We now have a connection, so set it up with the appropriate
         * socket options, file descriptors, and read/write buffers.
@@ -1719,12 +1719,12 @@ static int make_child(server_rec *s, int slot, time_t now)
     }
 
     if (one_process) {
-       signal(SIGHUP, just_die);
-       signal(SIGINT, just_die);
+       ap_signal(SIGHUP, just_die);
+       ap_signal(SIGINT, just_die);
 #ifdef SIGQUIT
-       signal(SIGQUIT, SIG_DFL);
+       ap_signal(SIGQUIT, SIG_DFL);
 #endif
-       signal(SIGTERM, just_die);
+       ap_signal(SIGTERM, just_die);
        child_main(slot);
     }
 
@@ -1772,9 +1772,9 @@ static int make_child(server_rec *s, int slot, time_t now)
         * Note that since restart() just notes that a restart has been
         * requested there's no race condition here.
         */
-       signal(SIGHUP, just_die);
-       signal(SIGUSR1, just_die);
-       signal(SIGTERM, just_die);
+       ap_signal(SIGHUP, just_die);
+       ap_signal(SIGUSR1, just_die);
+       ap_signal(SIGTERM, just_die);
        child_main(slot);
     }
 
@@ -2190,8 +2190,8 @@ int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
     }
 
     /* we've been told to restart */
-    signal(SIGHUP, SIG_IGN);
-    signal(SIGUSR1, SIG_IGN);
+    ap_signal(SIGHUP, SIG_IGN);
+    ap_signal(SIGUSR1, SIG_IGN);
     if (one_process) {
        /* not worth thinking about */
        return 1;