summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/MyPty.cpp
authormickeyl <mickeyl>2004-02-25 11:27:48 (UTC)
committer mickeyl <mickeyl>2004-02-25 11:27:48 (UTC)
commit25e87d9ccc92b7a4c12518532576f55b11726b26 (patch) (unidiff)
tree39c21854f8b6845736126a05f2cc89e552484881 /core/apps/embeddedkonsole/MyPty.cpp
parent50aef52b265bc8c8e5e5c6a871affe94142d74fb (diff)
downloadopie-25e87d9ccc92b7a4c12518532576f55b11726b26.zip
opie-25e87d9ccc92b7a4c12518532576f55b11726b26.tar.gz
opie-25e87d9ccc92b7a4c12518532576f55b11726b26.tar.bz2
fix most of zecke's comments. Someone should look into the open issues though
(see mail to opie-devel)
Diffstat (limited to 'core/apps/embeddedkonsole/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/MyPty.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp
index e7d8274..5a8519a 100644
--- a/core/apps/embeddedkonsole/MyPty.cpp
+++ b/core/apps/embeddedkonsole/MyPty.cpp
@@ -76,13 +76,12 @@
76#include <unistd.h> 76#include <unistd.h>
77#include <termios.h> 77#include <termios.h>
78#include <sys/types.h> 78#include <sys/types.h>
79#include <sys/ioctl.h> 79#include <sys/ioctl.h>
80#include <sys/wait.h> 80#include <sys/wait.h>
81 81
82#undef HAVE_OPENPTY
83#ifdef HAVE_OPENPTY 82#ifdef HAVE_OPENPTY
84#include <pty.h> 83#include <pty.h>
85#endif 84#endif
86 85
87#include "MyPty.h" 86#include "MyPty.h"
88 87
@@ -257,30 +256,30 @@ void MyPty::send_bytes(const char* s, int len)
257 printf("sending bytes:\n"); 256 printf("sending bytes:\n");
258 for (int i = 0; i < len; i++) 257 for (int i = 0; i < len; i++)
259 printf("%c", s[i]); 258 printf("%c", s[i]);
260 printf("\n"); 259 printf("\n");
261#endif 260#endif
262 261
263 ::write(fd, s, len); 262 ::write(fd, s, len);
264} 263}
265 264
266/*! indicates that a block of data is received */ 265/*! indicates that a block of data is received */
267void MyPty::readPty() 266void MyPty::readPty()
268{ 267{
269 char buf[4096]; 268 char buf[4096];
270 269
271 int len = ::read( fd, buf, 4096 ); 270 int len = ::read( fd, buf, 4096 );
272 271
273 if (len == -1) 272 if (len == -1)
274 donePty(); 273 donePty();
275 274
276 if (len < 0) 275 if (len < 0)
277 return; 276 return;
278 277
279 emit block_in(buf,len); 278 emit block_in(buf,len);
280 279
281#ifdef VERBOSE_DEBUG 280#ifdef VERBOSE_DEBUG
282 // verbose debug 281 // verbose debug
283 printf("read bytes:\n"); 282 printf("read bytes:\n");
284 for (int i = 0; i < len; i++) 283 for (int i = 0; i < len; i++)
285 printf("%c", buf[i]); 284 printf("%c", buf[i]);
286 printf("\n"); 285 printf("\n");