--- np2/x11/cmserial.c 2011/01/15 16:48:39 1.5 +++ np2/x11/cmserial.c 2012/01/23 04:23:10 1.8 @@ -1,5 +1,3 @@ -/* $Id: cmserial.c,v 1.5 2011/01/15 16:48:39 monaka Exp $ */ - /* * Copyright (c) 2004 NONAKA Kimihiro * All rights reserved. @@ -94,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;