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 @@ | |||
84 | 84 | ||
85 | #include "procctl.h" | ||
85 | #include "MyPty.h" | 86 | #include "MyPty.h" |
@@ -115,2 +116,3 @@ void MyPty::donePty() | |||
115 | if (m_cpid) { | 116 | if (m_cpid) { |
117 | qWarning("killing!!!"); | ||
116 | kill(m_cpid, SIGHUP); | 118 | kill(m_cpid, SIGHUP); |
@@ -119,3 +121,4 @@ void MyPty::donePty() | |||
119 | 121 | ||
120 | emit done(status); | 122 | m_cpid = 0; |
123 | // emit done(status); | ||
121 | } | 124 | } |
@@ -131,2 +134,3 @@ void MyPty::error() | |||
131 | { | 134 | { |
135 | qWarning("error"); | ||
132 | // This is code from the Qt DumbTerminal example | 136 | // This is code from the Qt DumbTerminal example |
@@ -184,5 +188,5 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
184 | QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); | 188 | QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); |
185 | QSocketNotifier* sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); | 189 | // QSocketNotifier* sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); |
186 | connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); | 190 | connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); |
187 | connect(sn_e,SIGNAL(activated(int)),this,SLOT(error())); | 191 | // connect(sn_e,SIGNAL(activated(int)),this,SLOT(error())); |
188 | 192 | ||
@@ -231,2 +235,3 @@ MyPty::MyPty(const Profile&) : m_cpid(0) | |||
231 | m_fd = openPty(); | 235 | m_fd = openPty(); |
236 | ProcCtl* ctl = ProcCtl::self(); | ||
232 | } | 237 | } |
@@ -261,3 +266,3 @@ void MyPty::send(const QByteArray& ar) | |||
261 | { | 266 | { |
262 | 267 | qWarning("sending!"); | |
263 | #ifdef VERBOSE_DEBUG | 268 | #ifdef VERBOSE_DEBUG |
@@ -276,2 +281,3 @@ void MyPty::readPty() | |||
276 | { | 281 | { |
282 | qWarning("read"); | ||
277 | QByteArray buf(4096); | 283 | QByteArray buf(4096); |
@@ -280,4 +286,9 @@ void MyPty::readPty() | |||
280 | 286 | ||
281 | if (len == -1) | 287 | if (len == -1 || len == 0) { |
288 | qWarning("donePty!!! now!"); | ||
282 | donePty(); | 289 | donePty(); |
290 | qWarning("return %s", sender()->className() ); | ||
291 | delete sender(); | ||
292 | return; | ||
293 | } | ||
283 | 294 | ||
@@ -286,2 +297,3 @@ void MyPty::readPty() | |||
286 | 297 | ||
298 | |||
287 | buf.resize(len); | 299 | buf.resize(len); |