--- np2/x11/cmserial.c 2011/01/15 18:43:13 1.6 +++ np2/x11/cmserial.c 2012/01/23 04:23:10 1.8 @@ -92,6 +92,10 @@ serialgetstat(COMMNG self) int rv; rv = ioctl(serial->hdl, TIOCMGET, &status); + if (rv < 0) { + VERBOSE(("serialgetstat: ioctl: %s", strerror(errno))); + return 0x20; + } if (!(status & TIOCM_DSR)) { VERBOSE(("serialgetstat: DSR is disable")); return 0x20;