summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index cacb4ce..ae01392 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -113,13 +113,15 @@ void MyPty::donePty()
113 113
114 ::close(m_fd); 114 ::close(m_fd);
115 115
116 if (m_cpid) { 116 if (m_cpid) {
117 qWarning("killing!!!"); 117 qWarning("killing!!!");
118 kill(m_cpid, SIGHUP); 118 kill(m_cpid, SIGHUP);
119 waitpid(m_cpid, &status, 0); 119 //waitpid(m_cpid, &status, 0);
120 delete m_sn_e;
121 m_sn_e = 0l;
120 } 122 }
121 123
122 m_cpid = 0; 124 m_cpid = 0;
123// emit done(status); 125// emit done(status);
124} 126}
125 127
@@ -183,15 +185,16 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
183 donePty(); 185 donePty();
184 exit(-1); 186 exit(-1);
185 } 187 }
186 188
187 // parent - continue as a widget 189 // parent - continue as a widget
188 QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); 190 QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this);
189// QSocketNotifier* sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); 191 delete m_sn_e;
192 m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this);
190 connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); 193 connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty()));
191// connect(sn_e,SIGNAL(activated(int)),this,SLOT(error())); 194 connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error()));
192 195
193 return 0; 196 return 0;
194} 197}
195 198
196int MyPty::openPty() 199int MyPty::openPty()
197{ 200{
@@ -229,12 +232,13 @@ int MyPty::openPty()
229 232
230/*! 233/*!
231 Create an instance. 234 Create an instance.
232*/ 235*/
233MyPty::MyPty(const Profile&) : m_cpid(0) 236MyPty::MyPty(const Profile&) : m_cpid(0)
234{ 237{
238 m_sn_e = 0l;
235 m_fd = openPty(); 239 m_fd = openPty();
236 ProcCtl* ctl = ProcCtl::self(); 240 ProcCtl* ctl = ProcCtl::self();
237} 241}
238 242
239/*! 243/*!
240 Destructor. 244 Destructor.