summaryrefslogtreecommitdiff
path: root/libexec/getty
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
parentc85540dd55bbfd01270e0b2c62d479d55c92cd18 (diff)
Notes
Diffstat (limited to 'libexec/getty')
-rw-r--r--libexec/getty/gettytab.51
-rw-r--r--libexec/getty/gettytab.h3
-rw-r--r--libexec/getty/init.c1
-rw-r--r--libexec/getty/main.c5
4 files changed, 7 insertions, 3 deletions
diff --git a/libexec/getty/gettytab.5 b/libexec/getty/gettytab.5
index 78c12a2310294..1e06fdc2ad810 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 b0a65e8cc6854..9e46b0da53a60 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 d06378b139fc2..d8c70e064e8dd 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 03536318e7447..6cd1af834ac2b 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 (;;) {