mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-01 11:15:57 +00:00
no need to set pty, screen is much metter
This commit is contained in:
@@ -50,7 +50,7 @@ struct option uwsgi_python_options[] = {
|
||||
#ifndef UWSGI_PYPY
|
||||
{"no-site", no_argument, &Py_NoSiteFlag, 1},
|
||||
#endif
|
||||
{"pyshell", optional_argument, 0, LONG_ARGS_PYSHELL},
|
||||
{"pyshell", no_argument, 0, LONG_ARGS_PYSHELL},
|
||||
|
||||
{0, 0, 0, 0},
|
||||
};
|
||||
@@ -732,9 +732,6 @@ int uwsgi_python_manage_options(int i, char *optarg) {
|
||||
case LONG_ARGS_PYSHELL:
|
||||
uwsgi.honour_stdin = 1;
|
||||
up.pyshell = 1;
|
||||
if (optarg) {
|
||||
up.pyshell_pts = optarg;
|
||||
}
|
||||
return 1;
|
||||
case LONG_ARGS_PYIMPORT:
|
||||
uwsgi_string_new_list(&up.import_list, optarg);
|
||||
@@ -1367,12 +1364,6 @@ void uwsgi_python_fixup() {
|
||||
uwsgi.p[30]->init_thread = NULL;
|
||||
}
|
||||
|
||||
int posix_openpt(int);
|
||||
int grantpt(int);
|
||||
int unlockpt(int);
|
||||
char *ptsname(int);
|
||||
#include <termios.h>
|
||||
|
||||
void uwsgi_python_hijack(void) {
|
||||
// the pyshell will be execute only in the first worker
|
||||
|
||||
@@ -1380,29 +1371,6 @@ void uwsgi_python_hijack(void) {
|
||||
if (up.pyshell && uwsgi.mywid == 1) {
|
||||
UWSGI_GET_GIL;
|
||||
PyImport_ImportModule("readline");
|
||||
if (up.pyshell_pts) {
|
||||
int masterfd = posix_openpt(O_RDWR|O_NOCTTY);
|
||||
grantpt (masterfd);
|
||||
unlockpt (masterfd);
|
||||
int sdong = open(ptsname (masterfd), O_RDWR);
|
||||
struct termios tt;
|
||||
tcgetattr(masterfd, &tt);
|
||||
// avoid echo-loop
|
||||
cfmakeraw(&tt);
|
||||
tcsetattr(masterfd, TCSADRAIN, &tt);
|
||||
|
||||
uwsgi_log("fd master = %d slave = %d\n", masterfd, sdong);
|
||||
uwsgi_log("slave = %s\n", ptsname (masterfd));
|
||||
|
||||
if (dup2(masterfd, 0) < 0) uwsgi_error("dup2()");
|
||||
if (dup2(masterfd, 1) < 0) uwsgi_error("dup2()");
|
||||
if (dup2(masterfd, 2) < 0) uwsgi_error("dup2()");
|
||||
|
||||
for(;;) {
|
||||
PyRun_InteractiveLoop(stdin, "uwsgi");
|
||||
uwsgi_log("again !!!\n");
|
||||
}
|
||||
}
|
||||
PyRun_InteractiveLoop(stdin, "uwsgi");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user