mirror of
https://github.com/simh/simh.git
synced 2026-02-12 02:48:38 +00:00
SERIAL, MUX: General fix for Windows Platform physical serial port output
Avoid Windows specific serial I/O behaviors which might not always have hardware state reported to user level code. The TMXR layer code already paces mux output so that reasonable behavior is observed.
This commit is contained in:
@@ -879,8 +879,6 @@ return read; /* return the number of
|
||||
|
||||
int32 sim_write_serial (SERHANDLE port, char *buffer, int32 count)
|
||||
{
|
||||
if (WaitForSingleObject (port->oWriteReady.hEvent, 0) == WAIT_TIMEOUT)
|
||||
return 0;
|
||||
if ((!WriteFile (port->hPort, (LPVOID) buffer, /* write the buffer to the serial port */
|
||||
(DWORD) count, NULL, &port->oWriteSync)) &&
|
||||
(GetLastError () != ERROR_IO_PENDING)) {
|
||||
@@ -888,12 +886,6 @@ if ((!WriteFile (port->hPort, (LPVOID) buffer, /* write the buffer to the seri
|
||||
(int) GetLastError ());
|
||||
return -1; /* return failure to caller */
|
||||
}
|
||||
if ((!WaitCommEvent (port->hPort, &port->dwEvtMask, &port->oWriteReady)) &&
|
||||
(GetLastError () != ERROR_IO_PENDING)) {
|
||||
sim_error_serial ("WaitCommEvent", /* function failed; report unexpected error */
|
||||
(int) GetLastError ());
|
||||
return -1; /* return failure to caller */
|
||||
}
|
||||
return count; /* return number of characters written/queued */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user