aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spawn-fcgi.c4
1 files 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;