Mercurial > ecos
changeset 1477:b300f8978722
* 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.
| author | asl |
|---|---|
| date | Tue, 20 Jan 2004 08:53:30 +0000 |
| parents | f2453fae08d4 |
| children | 5dd2b854cc32 |
| files | packages/io/serial/current/ChangeLog packages/io/serial/current/src/common/serial.c |
| diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,10 @@ +2004-01-12 Dan Jakubiec <djakubiec@yahoo.com> + + * 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 <jay@systech.com> * src/common/serial.c: Fixed bug for XON/XOFF flow control that
--- 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
