diff options
author | Fritz Elfert <felfert@to.com> | 2000-01-17 11:49:41 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2000-01-17 11:49:41 +0000 |
commit | ab18114bfd38d4632c66401b5bc079241e27fab3 (patch) | |
tree | 14f9c1d5f020cf8ed2f205094ca9e2fc907bb969 /ncpd/packet.cc | |
parent | 6eceb82662300bf306e70bd943200665bc3c9bc3 (diff) | |
download | plptools-ab18114bfd38d4632c66401b5bc079241e27fab3.tar.gz plptools-ab18114bfd38d4632c66401b5bc079241e27fab3.tar.bz2 plptools-ab18114bfd38d4632c66401b5bc079241e27fab3.zip |
Release of plptools-0.5
Diffstat (limited to 'ncpd/packet.cc')
-rw-r--r-- | ncpd/packet.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ncpd/packet.cc b/ncpd/packet.cc index 8099bb9..26823c8 100644 --- a/ncpd/packet.cc +++ b/ncpd/packet.cc @@ -33,6 +33,7 @@ #include <iomanip.h> #include <errno.h> #include <sys/ioctl.h> +#include <termios.h> extern "C" { #include "mp_serial.h" @@ -170,6 +171,10 @@ get(unsigned char &type, bufferStore & ret) } if (res < 0) return false; + // XXX Solaris returns 0 on non blocking TTY lines + // even when VMIN > 0 + if( res == 0 && inLen == 0 ) + return false; if (inLen >= BUFFERLEN) { cerr << "packet: input buffer overflow!!!!" << endl; inLen = 0; @@ -256,13 +261,17 @@ linkFailed() int res = ioctl(fd, TIOCMGET, &arg); if (res < 0) failed = true; - if (verbose & PKT_DEBUG_DUMP) + if (verbose & PKT_DEBUG_HANDSHAKE) cout << "packet: DTR:" << ((arg & TIOCM_DTR)?1:0) << " RTS:" << ((arg & TIOCM_RTS)?1:0) << " DCD:" << ((arg & TIOCM_CAR)?1:0) << " DSR:" << ((arg & TIOCM_DSR)?1:0) << " CTS:" << ((arg & TIOCM_CTS)?1:0) << endl; +#ifdef sun + if ((arg & TIOCM_CTS) == 0) +#else if (((arg & TIOCM_DSR) == 0) || ((arg & TIOCM_CTS) == 0)) +#endif failed = true; if ((verbose & PKT_DEBUG_LOG) && failed) cout << "packet: linkFAILED\n"; |