From: wessels <> Date: Fri, 19 Jul 1996 23:35:13 +0000 (+0000) Subject: call aio_init() only if it exists, and after leave_suid() X-Git-Tag: SQUID_3_0_PRE1~6028 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c54bb62fae1b15b7daedc7e1908cb2cb723892;p=thirdparty%2Fsquid.git call aio_init() only if it exists, and after leave_suid() --- 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; }