From 757969ef401e8d1b25a4d838bbad0be51ad9592b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 20 Oct 2012 07:46:29 -0700 Subject: [PATCH] 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. --- sim_serial.c | 2 +- sim_tmxr.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sim_serial.c b/sim_serial.c index ce30d1d2..146808f7 100644 --- a/sim_serial.c +++ b/sim_serial.c @@ -1249,7 +1249,7 @@ int written; 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 */ return (int32) written; /* return number of characters written */ diff --git a/sim_tmxr.c b/sim_tmxr.c index eac088dc..d83a63fc 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -1265,7 +1265,7 @@ if (nbytes) { /* >0? write */ else 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); lp->txbpr = (lp->txbpr + sbytes); /* update remove ptr */ if (lp->txbpr >= lp->txbsz) /* wrap? */ @@ -1273,7 +1273,6 @@ if (nbytes) { /* >0? write */ lp->txcnt = lp->txcnt + sbytes; /* update counts */ nbytes = nbytes - sbytes; } - if (nbytes && (lp->txbpr == 0)) { /* more data and wrap? */ sbytes = tmxr_write (lp, nbytes); if (sbytes > 0) { /* ok */ @@ -1423,7 +1422,7 @@ while (*tptr) { sim_close_sock (sock, 1); strcpy(listen, port); cptr = get_glyph (cptr, option, ';'); - if (cptr && (0 == MATCH_CMD (option, "NOTELNET"))) + if (option[0] && (0 == MATCH_CMD (option, "NOTELNET"))) listennotelnet = TRUE; } if (line == -1) {