The comment and code are out of sync. The comments say "leave control
lines alone on close." The HUPCL bit, when set, will "Lower modem control
lines after last process closes the device (hang up)."
To match the intent captured in the comment, the HUPCL bit should be
cleared.
Signed-off-by: Ben Gardiner <redacted>
data.term.c_cc[VTIME] = 0;
/* Ignore modem status lines; enable receiver; leave control lines alone on close. */
- data.term.c_cflag |= (CLOCAL | CREAD | HUPCL);
+ data.term.c_cflag |= (CLOCAL | CREAD);
+ data.term.c_cflag &= ~(HUPCL);
#endif
#ifdef _WIN32