diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index 2c8c27f5d..fd7abb808 100644 --- a/winsup/cygwin/fhandler_serial.cc +++ b/winsup/cygwin/fhandler_serial.cc @@ -388,7 +388,7 @@ fhandler_serial::ioctl (unsigned int cmd, void *buffer) DWORD ev; COMSTAT st; - if (ClearCommError (get_handle (), &ev, &st)) + if (!ClearCommError (get_handle (), &ev, &st)) { __seterrno (); res = -1;