*/
#ifndef lint
-static const char rcsid[] = "$Id: os_unix.c,v 1.30 2001/09/06 15:48:22 robs Exp $";
+static const char rcsid[] = "$Id: os_unix.c,v 1.31 2001/09/06 20:07:53 robs Exp $";
#endif /* not lint */
#include "fcgi_config.h"
static int shutdownPending = FALSE;
static int shutdownNow = FALSE;
-void OS_ShutdownNow()
+void OS_Shutdown()
{
shutdownNow = TRUE;
- shutdownPending = TRUE;
+ OS_ShutdownPending();
}
void OS_ShutdownPending()
shutdownPending = TRUE;
}
-void OS_SigtermHandler(int signo)
-{
- OS_ShutdownNow();
-}
-
-void OS_Sigusr1Handler(int signo)
+static void OS_Sigusr1Handler(int signo)
{
OS_ShutdownPending();
}
-void OS_SigpipeHandler(int signo)
+static void OS_SigpipeHandler(int signo)
{
;
}
}
}
-void OS_InstallSignalHandlers(int force)
+static void OS_InstallSignalHandlers(int force)
{
struct sigaction sa;
sa.sa_handler = OS_Sigusr1Handler;
installSignalHandler(SIGUSR1, &sa, force);
-
- sa.sa_handler = OS_SigtermHandler;
- installSignalHandler(SIGTERM, &sa, force);
}
/*
*/
void OS_LibShutdown()
{
- OS_ShutdownNow();
+ OS_Shutdown();
if(!libInitialized)
return;
&& ! shutdownPending);
if (socket < 0) {
- if (!is_reasonable_accept_errno(errno)) {
+ if (shutdownPending || ! is_reasonable_accept_errno(errno)) {
int errnoSave = errno;
ReleaseLock(listen_sock);
- if (shutdownPending)
- {
- OS_LibShutdown();
- }
- else
- {
+ if (! shutdownPending) {
errno = errnoSave;
}