Diffstat (limited to 'core/apps/embeddedkonsole/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/MyPty.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp index 7e820ad..e7d8274 100644 --- a/core/apps/embeddedkonsole/MyPty.cpp +++ b/core/apps/embeddedkonsole/MyPty.cpp | |||
@@ -78,8 +78,9 @@ | |||
78 | #include <sys/types.h> | 78 | #include <sys/types.h> |
79 | #include <sys/ioctl.h> | 79 | #include <sys/ioctl.h> |
80 | #include <sys/wait.h> | 80 | #include <sys/wait.h> |
81 | 81 | ||
82 | #undef HAVE_OPENPTY | ||
82 | #ifdef HAVE_OPENPTY | 83 | #ifdef HAVE_OPENPTY |
83 | #include <pty.h> | 84 | #include <pty.h> |
84 | #endif | 85 | #endif |
85 | 86 | ||
@@ -145,8 +146,14 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
145 | 146 | ||
146 | if ( !cpid ) { | 147 | if ( !cpid ) { |
147 | // child - exec shell on tty | 148 | // child - exec shell on tty |
148 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); | 149 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); |
150 | |||
151 | // attempt to keep apm driver from killing us on power on/off | ||
152 | signal(SIGSTOP, SIG_IGN); | ||
153 | signal(SIGCONT, SIG_IGN); | ||
154 | signal(SIGTSTP, SIG_IGN); | ||
155 | |||
149 | int ttyfd = open(ttynam, O_RDWR); | 156 | int ttyfd = open(ttynam, O_RDWR); |
150 | dup2(ttyfd, STDIN_FILENO); | 157 | dup2(ttyfd, STDIN_FILENO); |
151 | dup2(ttyfd, STDOUT_FILENO); | 158 | dup2(ttyfd, STDOUT_FILENO); |
152 | dup2(ttyfd, STDERR_FILENO); | 159 | dup2(ttyfd, STDERR_FILENO); |
@@ -162,10 +169,9 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
162 | tcgetattr( STDIN_FILENO, &ttmode ); | 169 | tcgetattr( STDIN_FILENO, &ttmode ); |
163 | ttmode.c_cc[VINTR] = 3; | 170 | ttmode.c_cc[VINTR] = 3; |
164 | ttmode.c_cc[VERASE] = 8; | 171 | ttmode.c_cc[VERASE] = 8; |
165 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); | 172 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); |
166 | if(strlen(getenv("TERM"))<=0) | 173 | setenv("TERM","vt100",1); |
167 | setenv("TERM","vt100",1); | ||
168 | setenv("COLORTERM","0",1); | 174 | setenv("COLORTERM","0",1); |
169 | 175 | ||
170 | if (getuid() == 0) { | 176 | if (getuid() == 0) { |
171 | char msg[] = "WARNING: You are running this shell as root!\n"; | 177 | char msg[] = "WARNING: You are running this shell as root!\n"; |