From: William A. Rowe Jr Date: Wed, 19 Dec 2007 03:02:22 +0000 (+0000) Subject: Handle args appropriately for an apr app. X-Git-Tag: 2.3.0~1129 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f968fe5d747e50515e9be73524c8f09bc68911b9;p=thirdparty%2Fapache%2Fhttpd.git Handle args appropriately for an apr app. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@605395 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/fcgistarter.c b/support/fcgistarter.c index f2eb26f7c9d..6eff3913928 100644 --- a/support/fcgistarter.c +++ b/support/fcgistarter.c @@ -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; } diff --git a/support/httxt2dbm.c b/support/httxt2dbm.c index ea61b39c47f..efe493af55c 100644 --- a/support/httxt2dbm.c +++ b/support/httxt2dbm.c @@ -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;