Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 10828b0..cacb4ce 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp @@ -84,2 +84,3 @@ +#include "procctl.h" #include "MyPty.h" @@ -115,2 +116,3 @@ void MyPty::donePty() if (m_cpid) { + qWarning("killing!!!"); kill(m_cpid, SIGHUP); @@ -119,3 +121,4 @@ void MyPty::donePty() - emit done(status); + m_cpid = 0; +// emit done(status); } @@ -131,2 +134,3 @@ void MyPty::error() { + qWarning("error"); // This is code from the Qt DumbTerminal example @@ -184,5 +188,5 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); - QSocketNotifier* sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); +// QSocketNotifier* sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); - connect(sn_e,SIGNAL(activated(int)),this,SLOT(error())); +// connect(sn_e,SIGNAL(activated(int)),this,SLOT(error())); @@ -231,2 +235,3 @@ MyPty::MyPty(const Profile&) : m_cpid(0) m_fd = openPty(); + ProcCtl* ctl = ProcCtl::self(); } @@ -261,3 +266,3 @@ void MyPty::send(const QByteArray& ar) { - + qWarning("sending!"); #ifdef VERBOSE_DEBUG @@ -276,2 +281,3 @@ void MyPty::readPty() { + qWarning("read"); QByteArray buf(4096); @@ -280,4 +286,9 @@ void MyPty::readPty() - if (len == -1) + if (len == -1 || len == 0) { + qWarning("donePty!!! now!"); donePty(); + qWarning("return %s", sender()->className() ); + delete sender(); + return; + } @@ -286,2 +297,3 @@ void MyPty::readPty() + buf.resize(len); |