From 932809088d5da036e1c46b5d615a1dfcebb5cef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Mon, 21 Jul 2008 18:51:26 +0200 Subject: [PATCH] Fix: do not close stdout/stderr in no-fork mode --- spawn-fcgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spawn-fcgi.c b/spawn-fcgi.c index 9e59a6e..844b0a7 100644 --- a/spawn-fcgi.c +++ b/spawn-fcgi.c @@ -507,8 +507,6 @@ int main(int argc, char **argv) { g_option_context_add_main_entries(context, entries, NULL); g_option_context_set_summary(context, PACKAGE_NAME "-" PACKAGE_VERSION " - spawns fastcgi processes"); - opts.close_fds = opts.no_fork ? opts.close_fds : !opts.keep_fds; - if (!g_option_context_parse (context, &argc, &argv, &error)) { g_printerr("Option parsing failed: %s\n", error->message); return -1; @@ -521,6 +519,8 @@ int main(int argc, char **argv) { } /* Check options */ + opts.close_fds = opts.no_fork ? opts.close_fds : !opts.keep_fds; + if ((opts.fcgiapp && opts.args) || (!opts.fcgiapp && !opts.args)) { g_printerr("Specify either a fcgi application with -f or the application with arguments after '--'\n"); return -1;