diff options
author | nsayer <nsayer@FreeBSD.org> | 2000-07-31 23:47:57 +0000 |
---|---|---|
committer | nsayer <nsayer@FreeBSD.org> | 2000-07-31 23:47:57 +0000 |
commit | 67331bf98c72c8f6d50b61ca5925f00192a488e6 (patch) | |
tree | 25767a7993307f115230ca05d9f4841aa3667746 /libexec | |
parent | 31d77bcfb10327e1e419acc02dbc3b7bc4e2185c (diff) | |
download | FreeBSD-src-67331bf98c72c8f6d50b61ca5925f00192a488e6.zip FreeBSD-src-67331bf98c72c8f6d50b61ca5925f00192a488e6.tar.gz |
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
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/getty/gettytab.5 | 1 | ||||
-rw-r--r-- | libexec/getty/gettytab.h | 3 | ||||
-rw-r--r-- | libexec/getty/init.c | 1 | ||||
-rw-r--r-- | libexec/getty/main.c | 5 |
4 files changed, 7 insertions, 3 deletions
diff --git a/libexec/getty/gettytab.5 b/libexec/getty/gettytab.5 index 78c12a2..1e06fdc 100644 --- a/libexec/getty/gettytab.5 +++ b/libexec/getty/gettytab.5 @@ -145,6 +145,7 @@ hangup line on last close .It "lo str" Ta Pa /usr/bin/login Ta .No "program to exec when name obtained" .It "mb bool false do flow control based on carrier" +.It "nc bool false terminal does not supply carrier (set clocal)" .It "nl bool false terminal has (or might have) a newline character" .It "np bool false terminal uses no parity (i.e. 8-bit characters)" .It "nx str default next table (for auto speed selection)" diff --git a/libexec/getty/gettytab.h b/libexec/getty/gettytab.h index b0a65e8..9e46b0d 100644 --- a/libexec/getty/gettytab.h +++ b/libexec/getty/gettytab.h @@ -170,5 +170,6 @@ struct gettyflags { #define DX gettyflags[20].value #define NP gettyflags[21].value #define MB gettyflags[22].value -#define HW gettyflags[23].value +#define HW gettyflags[23].value +#define NC gettyflags[24].value diff --git a/libexec/getty/init.c b/libexec/getty/init.c index d06378b..d8c70e0 100644 --- a/libexec/getty/init.c +++ b/libexec/getty/init.c @@ -146,5 +146,6 @@ struct gettyflags gettyflags[] = { { "np", 0 }, /* no parity at all (8bit chars) */ { "mb", 0 }, /* do MDMBUF flow control */ { "hw", 0 }, /* do CTSRTS flow control */ + { "nc", 0 }, /* set clocal (no carrier) */ { 0 } }; diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 0353631..6cd1af8 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 (;;) { |