TMXR: Avoid closing file descriptor 0 when disabling serial port console output

Properly initialize TMXR structure when attaching to a serial port so a
subsequent close will not attempt to close the uninitialized ring_sock.
This commit is contained in:
Mark Pizzolato 2016-07-15 03:58:52 -07:00
parent a9e17075ce
commit b8b95c7b20

View file

@ -2393,6 +2393,10 @@ for (i = 0; i < mp->lines; i++) { /* initialize lines */
if (lp->rxbpsfactor == 0.0)
lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE;
}
mp->ring_sock = INVALID_SOCKET;
free (mp->ring_ipad);
mp->ring_ipad = NULL;
mp->ring_start_time = 0;
tmxr_debug_trace (mp, "tmxr_open_master()");
while (*tptr) {
line = nextline;