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:
parent
a9e17075ce
commit
b8b95c7b20
1 changed files with 4 additions and 0 deletions
|
@ -2393,6 +2393,10 @@ for (i = 0; i < mp->lines; i++) { /* initialize lines */
|
||||||
if (lp->rxbpsfactor == 0.0)
|
if (lp->rxbpsfactor == 0.0)
|
||||||
lp->rxbpsfactor = TMXR_RX_BPS_UNIT_SCALE;
|
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()");
|
tmxr_debug_trace (mp, "tmxr_open_master()");
|
||||||
while (*tptr) {
|
while (*tptr) {
|
||||||
line = nextline;
|
line = nextline;
|
||||||
|
|
Loading…
Add table
Reference in a new issue