/* @(#)getttyent.c 4.1 (Berkeley) %G% */
static char TTYFILE
[] = "/etc/ttys";
static char EMPTY
[] = "";
static char line
[BUFSIZ
+1];
static struct ttyent tty
;
tf
= fopen(TTYFILE
, "r");
while ((c
= *p
) != '\0') {
if (c
== '\t' || c
== ' ' || c
== '\n') {
while ((c
= *p
) == '\t' || c
== ' ' || c
== '\n')
if ((tf
= fopen(TTYFILE
, "r")) == NULL
)
p
= fgets(line
, BUFSIZ
, tf
);
while ((c
= *p
) == '\t' || c
== ' ' || c
== '\n')
} while (c
== '\0' || c
== '#');
for (p
= skip(p
); *p
; p
= cp
) {
if (strcmp(p
, "on") == 0)
else if (strcmp(p
, "off") == 0)
tty
.ty_status
&= ~TTY_ON
;
else if (strcmp(p
, "secure") == 0)
tty
.ty_status
|= TTY_SECURE
;