mirror of
https://github.com/open-simh/simh.git
synced 2026-01-13 15:27:46 +00:00
SERIAL: For writes to serial ports, accept both EAGAIN and EWOULDBLOCK as non-error conditions for all *nix hosts
This commit is contained in:
parent
53690b3a15
commit
65edda68ad
10
sim_serial.c
10
sim_serial.c
@ -1324,10 +1324,14 @@ int written;
|
||||
written = write (port, (void *) buffer, (size_t) count); /* write the buffer to the serial port */
|
||||
|
||||
if (written == -1) {
|
||||
if (errno != EAGAIN) /* unexpected error? */
|
||||
sim_error_serial ("write", errno); /* report it */
|
||||
else
|
||||
if (errno == EWOULDBLOCK)
|
||||
written = 0; /* not an error, but nothing written */
|
||||
#if defined(EAGAIN)
|
||||
else if (errno == EAGAIN)
|
||||
written = 0; /* not an error, but nothing written */
|
||||
#endif
|
||||
else /* unexpected error? */
|
||||
sim_error_serial ("write", errno); /* report it */
|
||||
}
|
||||
|
||||
return (int32) written; /* return number of characters written */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user