From 34c54bb62fae1b15b7daedc7e1908cb2cb723892 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Fri, 19 Jul 1996 23:35:13 +0000 Subject: [PATCH] call aio_init() only if it exists, and after leave_suid() --- src/main.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.cc b/src/main.cc index cc216fb2e3..797f86ae32 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.51 1996/07/15 23:48:34 wessels Exp $ + * $Id: main.cc,v 1.52 1996/07/19 17:35:13 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -206,6 +206,7 @@ static void mainParseOptions(argc, argv) case 'm': #if MALLOC_DBG malloc_debug_level = atoi(optarg); + /* NOTREACHED */ break; #else fatal("Need to add -DMALLOC_DBG when compiling to use -m option"); @@ -389,11 +390,6 @@ static void mainInitialize() } squid_signal(SIGPIPE, SIG_IGN, SA_RESTART); squid_signal(SIGCHLD, sig_child, SA_NODEFER | SA_RESTART); -#if USE_ASYNC_IO - if (first_time) - aio_init(); - squid_signal(SIGIO, aioSigHandler, SA_RESTART); -#endif if (ConfigFile == NULL) ConfigFile = xstrdup(DefaultConfigFile); @@ -401,6 +397,14 @@ static void mainInitialize() leave_suid(); /* Run as non privilegied user */ +#if USE_ASYNC_IO +#if HAVE_AIO_INIT + if (first_time) + aio_init(); +#endif + squid_signal(SIGIO, aioSigHandler, SA_RESTART); +#endif + if (httpPortNumOverride != 1) setHttpPortNum((u_short) httpPortNumOverride); if (icpPortNumOverride != 1) @@ -592,6 +596,5 @@ int main(argc, argv) } } /* NOTREACHED */ - exit(0); return 0; } -- 2.47.2