summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--serial.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/serial.c b/serial.c
index f2287d1b..401d83bf 100644
--- a/serial.c
+++ b/serial.c
@@ -96,7 +96,9 @@ void serial_close()
tcsetattr(ttyfd, TCSANOW, &ttyset);
}
/* Restore original terminal parameters */
- tcsetattr(ttyfd,TCSANOW,&ttyset_old);
+ /* but make sure DTR goes down */
+ ttyset_old.c_cflag |= HUPCL;
+ tcsetattr(ttyfd,TCSANOW,&ttyset_old);
close(ttyfd);
ttyfd = -1;