From c5877df60c6a5270626fb34a519b201a6efdaa24 Mon Sep 17 00:00:00 2001 From: "roberto@mrspurr" Date: Fri, 10 Sep 2010 08:35:34 +0200 Subject: [PATCH] fix --logto usage in cherokee --- simple_app.py | 2 +- utils.c | 12 +++++++----- xmlconf.c | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/simple_app.py b/simple_app.py index bdd9e13e..2dad9bd1 100644 --- a/simple_app.py +++ b/simple_app.py @@ -1,6 +1,6 @@ import uwsgi -print "uWSGI version:", uwsgi.version +print "!!! uWSGI version:", uwsgi.version def ciao(): print "modifica su /tmp" diff --git a/utils.c b/utils.c index f0ff7e8b..2014c1f4 100644 --- a/utils.c +++ b/utils.c @@ -155,18 +155,20 @@ void logto(char *logfile) { /* stdout */ - if (dup2(fd, 1) < 0) { - uwsgi_error("dup2()"); - exit(1); + if (fd != 1) { + if (dup2(fd, 1) < 0) { + uwsgi_error("dup2()"); + exit(1); + } + close(fd); } /* stderr */ - if (dup2(fd, 2) < 0) { + if (dup2(1, 2) < 0) { uwsgi_error("dup2()"); exit(1); } - close(fd); } diff --git a/xmlconf.c b/xmlconf.c index 7092ffe8..d3db6bb8 100644 --- a/xmlconf.c +++ b/xmlconf.c @@ -86,7 +86,6 @@ void uwsgi_xml_config(struct wsgi_request *wsgi_req, struct option *long_options } else if (node->type == XML_ELEMENT_NODE) { - uwsgi_log("%s\n", node->name); if (!strcmp((char *) node->name, "app")) { uwsgi.xml_round2 = 1 ; continue;