aboutsummaryrefslogtreecommitdiff
path: root/libexec/getty/main.c
diff options
context:
space:
mode:
authorNick Sayer <nsayer@FreeBSD.org>2000-07-31 23:47:57 +0000
committerNick Sayer <nsayer@FreeBSD.org>2000-07-31 23:47:57 +0000
commit3d4a189e9f2bb78a7cb69e1b8e88465f6cffcbd2 (patch)
tree237f45c02cb777f82b187b0568102a7af28d2c3b /libexec/getty/main.c
parentc85540dd55bbfd01270e0b2c62d479d55c92cd18 (diff)
downloadsrc-3d4a189e9f2bb78a7cb69e1b8e88465f6cffcbd2.tar.gz
src-3d4a189e9f2bb78a7cb69e1b8e88465f6cffcbd2.zip
Add 'nc' flag to gettytab -- no carrier. Forces non-blocking open and
setting of CLOCAL. Necessary for 3 wire RS-232 setups with dumb terminals. PR: 5959
Notes
Notes: svn path=/head/; revision=64076
Diffstat (limited to 'libexec/getty/main.c')
-rw-r--r--libexec/getty/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 03536318e744..6cd1af834ac2 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -270,8 +270,8 @@ main(argc, argv)
(void)tcsetattr(STDIN_FILENO, TCSANOW, &tmode);
exit(1);
}
- } else { /* blocking open */
- if (!opentty(ttyn, O_RDWR))
+ } else { /* maybe blocking open */
+ if (!opentty(ttyn, O_RDWR | (NC ? O_NONBLOCK : 0 )))
exit(1);
}
}
@@ -293,6 +293,7 @@ main(argc, argv)
tmode.c_oflag = TTYDEF_OFLAG;
tmode.c_lflag = TTYDEF_LFLAG;
tmode.c_cflag = TTYDEF_CFLAG;
+ tmode.c_cflag |= (NC ? CLOCAL : 0);
omode = tmode;
for (;;) {