improved screen support

This commit is contained in:
roberto@debian3
2011-09-21 06:09:05 +02:00
parent e402e7805d
commit 4e8c8ef317
5 changed files with 38 additions and 0 deletions
+9
View File
@@ -1369,6 +1369,15 @@ void uwsgi_python_hijack(void) {
#ifndef UWSGI_PYPY
if (up.pyshell && uwsgi.mywid == 1) {
// re-map stdin to stdout and stderr if we are logging to a file
if (uwsgi.logfile) {
if (dup2(0, 1) < 0) {
uwsgi_error("dup2()");
}
if (dup2(0, 2) < 0) {
uwsgi_error("dup2()");
}
}
UWSGI_GET_GIL;
PyImport_ImportModule("readline");
PyRun_InteractiveLoop(stdin, "uwsgi");