From: Jeff Trawick Date: Wed, 5 Apr 2000 01:23:51 +0000 (+0000) Subject: stop relying on a macro to map signal() to ap_signal(); call X-Git-Tag: apache-doc-split-01~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92cafef56bf81ab0c3077650990241087a99affe;p=apache stop relying on a macro to map signal() to ap_signal(); call ap_signal() directly git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84914 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 8c84861236..155aedcc0f 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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 */ diff --git a/server/log.c b/server/log.c index a6c857bce6..c67036628d 100644 --- a/server/log.c +++ b/server/log.c @@ -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) || diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 02263a2146..b75c514df7 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -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 */ diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 83e73108ce..0dac56a45f 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -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 */ diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 91f0a1e5f8..4bf053b70a 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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;