From e402e7805d92572d9a4e97b6e3dfdd5af569115f Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Wed, 21 Sep 2011 05:27:58 +0200 Subject: [PATCH] no need to set pty, screen is much metter --- plugins/python/python_plugin.c | 34 +--------------------------------- plugins/python/uwsgi_python.h | 1 - 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 8d99ca2d..273a2a92 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -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 - 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); } diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h index 2ecfa0ec..ce5be320 100644 --- a/plugins/python/uwsgi_python.h +++ b/plugins/python/uwsgi_python.h @@ -128,7 +128,6 @@ struct uwsgi_python { char *test_module; int pyshell; - char *pyshell_pts; struct uwsgi_string_list *python_path; struct uwsgi_string_list *import_list;