# HG changeset patch # User asl # Date 1074588810 0 # Node ID b300f8978722a43158b7a7364eb3d2f1d166977a # Parent f2453fae08d493eb8df52081ec71d038fd36ab5d * src/common/serial.c: serial_write() was returning an incorrect result code in non-blocking mode when output was blocked. The previous code would return ENOERR with 0 bytes written. This was fixed to return EAGAIN. diff --git a/packages/io/serial/current/ChangeLog b/packages/io/serial/current/ChangeLog --- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,10 @@ +2004-01-12 Dan Jakubiec + + * src/common/serial.c: serial_write() was returning an incorrect + result code in non-blocking mode when output was blocked. The + previous code would return ENOERR with 0 bytes written. This + was fixed to return EAGAIN. + 2003-08-18 Jay Foster * src/common/serial.c: Fixed bug for XON/XOFF flow control that diff --git a/packages/io/serial/current/src/common/serial.c b/packages/io/serial/current/src/common/serial.c --- a/packages/io/serial/current/src/common/serial.c +++ b/packages/io/serial/current/src/common/serial.c @@ -354,7 +354,7 @@ serial_write(cyg_io_handle_t handle, con if (!cbuf->blocking) { *len -= size; // number of characters actually sent cbuf->waiting = false; - res = size == 0 ? -EAGAIN : ENOERR; + res = (*len == 0) ? -EAGAIN : ENOERR; break; } #endif // CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING