]> granicus.if.org Git - apache/commitdiff
* support/fcgistarter.c
authorGarrett Rooney <rooneg@apache.org>
Sat, 22 Apr 2006 03:55:02 +0000 (03:55 +0000)
committerGarrett Rooney <rooneg@apache.org>
Sat, 22 Apr 2006 03:55:02 +0000 (03:55 +0000)
  (main): Oops, we need to detach before the fork, otherwise this all
   totally fails to work...

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@396069 13f79535-47bb-0310-9956-ffa450edef68

support/fcgistarter.c

index ad9b9e5490658423aee3f35e783521de1be9349a..43500e82e87031d7a95874ce2471e6ccad7466f9 100644 (file)
@@ -144,17 +144,17 @@ int main(int argc, const char *argv[])
         exit_error(rv, "apr_socket_listen");
     }
 
+    rv = apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
+    if (rv) {
+        exit_error(rv, "apr_proc_detach");
+    }
+
     while (--num_to_start >= 0) {
         rv = apr_proc_fork(&proc, pool);
         if (rv == APR_INCHILD) {
             apr_os_file_t oft = 0;
             apr_os_sock_t oskt;
 
-            rv = apr_proc_detach(APR_PROC_DETACH_DAEMONIZE);
-            if (rv) {
-                exit_error(rv, "apr_proc_detach");
-            }
-
 #if defined(WIN32) || defined(OS2) || defined(NETWARE)
 #error "Please implement me."
 #else