]> granicus.if.org Git - apache/commitdiff
Handle args appropriately for an apr app.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 19 Dec 2007 03:02:22 +0000 (03:02 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 19 Dec 2007 03:02:22 +0000 (03:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@605395 13f79535-47bb-0310-9956-ffa450edef68

support/fcgistarter.c
support/httxt2dbm.c

index f2eb26f7c9d0290c0eef58988c1077b00b11c96f..6eff391392830bb8af7a0d2a5f64e830a997725e 100644 (file)
@@ -53,7 +53,7 @@ static void exit_error(apr_status_t rv, const char *func)
     exit(EXIT_FAILURE);
 }
 
-int main(int argc, const char *argv[])
+int main(int argc, const char * const argv[])
 {
     apr_file_t *infd, *skwrapper;
     apr_sockaddr_t *skaddr;
@@ -69,7 +69,7 @@ int main(int argc, const char *argv[])
     const char *interface = NULL;
     const char *command = NULL;
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
 
     atexit(apr_terminate);
 
@@ -148,16 +148,18 @@ int main(int argc, const char *argv[])
         exit_error(rv, "apr_proc_detach");
     }
 
+#if defined(WIN32) || defined(OS2) || defined(NETWARE)
+
+#error "Please implement me."
+
+#else
+
     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;
 
-#if defined(WIN32) || defined(OS2) || defined(NETWARE)
-#error "Please implement me."
-#else
-
             /* Ok, so we need a file that has file descriptor 0 (which
              * FastCGI wants), but points to our socket.  This isn't really
              * possible in APR, so we cheat a bit.  I have no idea how to
@@ -197,7 +199,7 @@ int main(int argc, const char *argv[])
              *     is no longer fd 0, so it doesn't work.  Sigh. */
 
             execl(command, command, NULL);
-#endif
+
         } else if (rv == APR_INPARENT) {
             if (num_to_start == 0) {
                 apr_socket_close(skt);
@@ -207,5 +209,7 @@ int main(int argc, const char *argv[])
         }
     }
 
+#endif
+
     return EXIT_SUCCESS;
 }
index ea61b39c47f6a920cbd38465e19b1024629c35a8..efe493af55c38d4275943e5a4661de9b694e3c43 100644 (file)
@@ -183,7 +183,7 @@ int main(int argc, const char *const argv[])
     apr_file_t *infile;
     apr_dbm_t *outdbm;
 
-    apr_initialize();
+    apr_app_initialize(&argc, &argv, NULL);
     atexit(apr_terminate);
 
     verbose = 0;