mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 14:41:55 +00:00
fix spooler stdin
This commit is contained in:
@@ -78,6 +78,9 @@ void spooler(struct uwsgi_server *uwsgi, PyObject * uwsgi_module_dict) {
|
||||
int rlen = 0;
|
||||
int datasize;
|
||||
|
||||
// prevent process blindly reading stdin to make mess
|
||||
int nullfd;
|
||||
|
||||
struct uwsgi_header uh;
|
||||
|
||||
char *key;
|
||||
@@ -114,6 +117,17 @@ void spooler(struct uwsgi_server *uwsgi, PyObject * uwsgi_module_dict) {
|
||||
uwsgi_log( "lowering spooler priority to %d\n", PRIO_MAX);
|
||||
setpriority(PRIO_PROCESS, getpid(), PRIO_MAX);
|
||||
|
||||
nullfd = open("/dev/null", O_RDONLY);
|
||||
if (nullfd < 0) {
|
||||
uwsgi_error("open()");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (nullfd != 0) {
|
||||
dup2(nullfd, 0);
|
||||
close(nullfd);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
|
||||
sleep(uwsgi->shared->spooler_frequency);
|
||||
|
||||
Reference in New Issue
Block a user