]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
call aio_init() only if it exists, and after leave_suid()
authorwessels <>
Fri, 19 Jul 1996 23:35:13 +0000 (23:35 +0000)
committerwessels <>
Fri, 19 Jul 1996 23:35:13 +0000 (23:35 +0000)
src/main.cc

index cc216fb2e33122a1c84dbcc7a179e1f98edec8fe..797f86ae3237afccc4e5fed25f1e05cc8eb2a45b 100644 (file)
@@ -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;
 }