summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/MyPty.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/MyPty.cpp10
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
@@ -79,6 +79,7 @@
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
@@ -146,6 +147,12 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
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);
@@ -163,8 +170,7 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
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) {