summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-25 19:34:27 (UTC)
committer harlekin <harlekin>2002-10-25 19:34:27 (UTC)
commit77347ba522a5913ff17561e6fd2c15981d42e86b (patch) (side-by-side diff)
tree9e865d9b8d9ca2bfdda98a823531359b3004e46a
parent9adbe632ec54bf155b9882e4e0b51c293259cdf2 (diff)
downloadopie-77347ba522a5913ff17561e6fd2c15981d42e86b.zip
opie-77347ba522a5913ff17561e6fd2c15981d42e86b.tar.gz
opie-77347ba522a5913ff17561e6fd2c15981d42e86b.tar.bz2
cough
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index 2570826..534f79a 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -116,65 +116,65 @@ void MyPty::donePty()
if (m_cpid) {
kill(m_cpid, SIGHUP);
//waitpid(m_cpid, &status, 0);
delete m_sn_e;
delete m_sn_r;
m_sn_e = 0l;
m_sn_r = 0l;
}
m_cpid = 0;
m_fd = -1;
// emit done(status);
}
const char* MyPty::deviceName()
{
return m_ttynam;
}
void MyPty::error()
{
// This is code from the Qt DumbTerminal example
donePty();
}
void MyPty::start() {
char* cmd = "/bin/sh";
if ( QFile::exists( "/bin/bash" ) ) {
- char* cmd = "/bin/bash";
+ cmd = "/bin/bash";
}
QStrList lis;
int r =run(cmd, lis, 0, 0);
r = r;
}
/*!
start the client program.
*/
int MyPty::run(const char* cmd, QStrList &, const char*, int)
{
// This is code from the Qt DumbTerminal example
m_cpid = fork();
if ( !m_cpid ) {
// child - exec shell on tty
for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL);
int ttyfd = ::open(m_ttynam, O_RDWR);
dup2(ttyfd, STDIN_FILENO);
dup2(ttyfd, STDOUT_FILENO);
dup2(ttyfd, STDERR_FILENO);
// should be done with tty, so close it
::close(ttyfd);
static struct termios ttmode;
if ( setsid() < 0 )
perror( "failed to set process group" );
#if defined (TIOCSCTTY)
// grabbed from APUE by Stevens
ioctl(STDIN_FILENO, TIOCSCTTY, 0);
#endif
tcgetattr( STDIN_FILENO, &ttmode );
ttmode.c_cc[VINTR] = 3;