summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index ae01392..b6ae1d9 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -111,13 +111,12 @@ void MyPty::donePty()
111 // This is code from the Qt DumbTerminal example 111 // This is code from the Qt DumbTerminal example
112 int status = 0; 112 int status = 0;
113 113
114 ::close(m_fd); 114 ::close(m_fd);
115 115
116 if (m_cpid) { 116 if (m_cpid) {
117 qWarning("killing!!!");
118 kill(m_cpid, SIGHUP); 117 kill(m_cpid, SIGHUP);
119 //waitpid(m_cpid, &status, 0); 118 //waitpid(m_cpid, &status, 0);
120 delete m_sn_e; 119 delete m_sn_e;
121 m_sn_e = 0l; 120 m_sn_e = 0l;
122 } 121 }
123 122
@@ -131,13 +130,12 @@ const char* MyPty::deviceName()
131 return m_ttynam; 130 return m_ttynam;
132} 131}
133 132
134 133
135void MyPty::error() 134void MyPty::error()
136{ 135{
137 qWarning("error");
138 // This is code from the Qt DumbTerminal example 136 // This is code from the Qt DumbTerminal example
139 donePty(); 137 donePty();
140} 138}
141 139
142void MyPty::start() { 140void MyPty::start() {
143 char* cmd = "/bin/sh"; 141 char* cmd = "/bin/sh";
@@ -265,13 +263,12 @@ void MyPty::close() {
265void MyPty::reload( const Profile& ) { 263void MyPty::reload( const Profile& ) {
266 264
267} 265}
268/*! sends len bytes through the line */ 266/*! sends len bytes through the line */
269void MyPty::send(const QByteArray& ar) 267void MyPty::send(const QByteArray& ar)
270{ 268{
271 qWarning("sending!");
272#ifdef VERBOSE_DEBUG 269#ifdef VERBOSE_DEBUG
273 // verbose debug 270 // verbose debug
274 printf("sending bytes:\n"); 271 printf("sending bytes:\n");
275 for (uint i = 0; i < ar.count(); i++) 272 for (uint i = 0; i < ar.count(); i++)
276 printf("%c", ar[i]); 273 printf("%c", ar[i]);
277 printf("\n"); 274 printf("\n");
@@ -280,21 +277,18 @@ void MyPty::send(const QByteArray& ar)
280 ::write(m_fd, ar.data(), ar.count()); 277 ::write(m_fd, ar.data(), ar.count());
281} 278}
282 279
283/*! indicates that a block of data is received */ 280/*! indicates that a block of data is received */
284void MyPty::readPty() 281void MyPty::readPty()
285{ 282{
286 qWarning("read");
287 QByteArray buf(4096); 283 QByteArray buf(4096);
288 284
289 int len = ::read( m_fd, buf.data(), 4096 ); 285 int len = ::read( m_fd, buf.data(), 4096 );
290 286
291 if (len == -1 || len == 0) { 287 if (len == -1 || len == 0) {
292 qWarning("donePty!!! now!");
293 donePty(); 288 donePty();
294 qWarning("return %s", sender()->className() );
295 delete sender(); 289 delete sender();
296 return; 290 return;
297 } 291 }
298 292
299 if (len < 0) 293 if (len < 0)
300 return; 294 return;