Mercurial > hgrepos > FreeBSD > ports > www > uwsginl
diff files/patch-core-logging.c @ 118:20416e8b70cc origin
Update to 2.0.19.1
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 16 May 2021 15:55:19 +0200 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/files/patch-core-logging.c Sun May 16 15:55:19 2021 +0200 @@ -0,0 +1,32 @@ +--- core/logging.c.orig 2020-11-06 10:12:49.865752000 +0100 ++++ core/logging.c 2020-11-06 10:17:57.825745000 +0100 +@@ -536,13 +536,23 @@ + uwsgi_error_open(logfile); + exit(1); + } +- else { +- if (dup2(fd, log_fd) < 0) { +- // this could be lost :( +- uwsgi_error("uwsgi_log_do_rotate()/dup2()"); +- exit(1); +- } ++ if (dup2(fd, log_fd) < 0) { ++ // this could be lost :( ++ uwsgi_error("uwsgi_log_do_rotate()/dup2()"); + close(fd); ++ exit(1); ++ } ++ close(fd); ++ ++ if (uwsgi.chmod_logfile_value) { ++ if (fchmod(log_fd, uwsgi.chmod_logfile_value)) { ++ uwsgi_error("fchmod()"); ++ } ++ } ++ if (uwsgi.logfile_chown) { ++ if (fchown(log_fd, uwsgi.uid, uwsgi.gid)) { ++ uwsgi_error("fchown()"); ++ } + } + } + else {
