diff --git a/sim_serial.c b/sim_serial.c index 167c04fd..2d1dc95a 100644 --- a/sim_serial.c +++ b/sim_serial.c @@ -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 */ } diff --git a/sim_tmxr.c b/sim_tmxr.c index 719350d1..820763ff 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -701,7 +701,7 @@ if (lp->serport) { /* serial port connectio return 0; written = sim_write_serial (lp->serport, &(lp->txb[i]), length); if (written > 0) - lp->txnexttime = floor (sim_gtime () + (lp->txdelta * sim_timer_inst_per_sec ())); + lp->txnexttime = floor (sim_gtime () + (written * lp->txdelta * sim_timer_inst_per_sec ())); return written; } else { /* Telnet connection */