summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemco Treffkorn <remco@rvt.com>2002-10-29 23:25:59 +0000
committerRemco Treffkorn <remco@rvt.com>2002-10-29 23:25:59 +0000
commit3641b8ccc78d09f9ac0a52dd98d4241a757738ac (patch)
tree8d691e507d750110a37457c107ef9cc42710e0e9
parent21378c4e48397659c1232aa6457b25a79e0ab0f2 (diff)
downloadgpsd-3641b8ccc78d09f9ac0a52dd98d4241a757738ac.tar.gz
Drop DTR on close. Before we depended on the ttys HUPCL setting.
-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;