Fixed bugs found during testing by Mark Benson

sim_serial.c

    - Fixed error message printing when retry is merely needed

sim_tmxr.c
     - Fixed parsing to properly recognize a listen port argument of "nnn;notelnet".
     - Fixed buffer wrap output condition.
This commit is contained in:
Mark Pizzolato 2012-10-20 07:46:29 -07:00
parent 0a46da5aa0
commit 757969ef40
2 changed files with 3 additions and 4 deletions

View file

@ -1249,7 +1249,7 @@ int written;
written = write (port, (void *) buffer, (size_t) count); /* write the buffer to the serial port */ written = write (port, (void *) buffer, (size_t) count); /* write the buffer to the serial port */
if (written == -1) /* write error? */ if ((written == -1) && (errno != EAGAIN)) /* write error? */
sim_error_serial ("write", errno); /* report unexpected error */ sim_error_serial ("write", errno); /* report unexpected error */
return (int32) written; /* return number of characters written */ return (int32) written; /* return number of characters written */

View file

@ -1265,7 +1265,7 @@ if (nbytes) { /* >0? write */
else else
sbytes = tmxr_write (lp, lp->txbsz - lp->txbpr);/* write to end buf */ sbytes = tmxr_write (lp, lp->txbsz - lp->txbpr);/* write to end buf */
if (sbytes > 0) { /* ok? */ if (sbytes >= 0) { /* ok? */
tmxr_debug (TMXR_DBG_XMT, lp, "Sent", &(lp->txb[lp->txbpr]), sbytes); tmxr_debug (TMXR_DBG_XMT, lp, "Sent", &(lp->txb[lp->txbpr]), sbytes);
lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */
if (lp->txbpr >= lp->txbsz) /* wrap? */ if (lp->txbpr >= lp->txbsz) /* wrap? */
@ -1273,7 +1273,6 @@ if (nbytes) { /* >0? write */
lp->txcnt = lp->txcnt + sbytes; /* update counts */ lp->txcnt = lp->txcnt + sbytes; /* update counts */
nbytes = nbytes - sbytes; nbytes = nbytes - sbytes;
} }
if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */ if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */
sbytes = tmxr_write (lp, nbytes); sbytes = tmxr_write (lp, nbytes);
if (sbytes > 0) { /* ok */ if (sbytes > 0) { /* ok */
@ -1423,7 +1422,7 @@ while (*tptr) {
sim_close_sock (sock, 1); sim_close_sock (sock, 1);
strcpy(listen, port); strcpy(listen, port);
cptr = get_glyph (cptr, option, ';'); cptr = get_glyph (cptr, option, ';');
if (cptr && (0 == MATCH_CMD (option, "NOTELNET"))) if (option[0] && (0 == MATCH_CMD (option, "NOTELNET")))
listennotelnet = TRUE; listennotelnet = TRUE;
} }
if (line == -1) { if (line == -1) {