From 08443d54637efe9b00d4a1829668c3c188554e2f Mon Sep 17 00:00:00 2001 From: Unbit Date: Sat, 11 Jan 2014 07:36:01 +0100 Subject: [PATCH] fixed logfile-chown --- core/utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/utils.c b/core/utils.c index c586a279..c324e145 100644 --- a/core/utils.c +++ b/core/utils.c @@ -754,7 +754,11 @@ void uwsgi_as_root() { } if (uwsgi.logfile_chown) { - if (fchown(2, uwsgi.uid, uwsgi.gid)) { + int log_fd = 2; + if (uwsgi.log_master && uwsgi.original_log_fd > -1) { + log_fd = uwsgi.original_log_fd; + } + if (fchown(log_fd, uwsgi.uid, uwsgi.gid)) { uwsgi_error("fchown()"); exit(1); }