return (t);
}
+static char *skip __P((char *)) internal_function;
+static char *value __P((char *)) internal_function;
+
struct ttyent *
getttyent()
{
register char *p;
#define MAXLINELENGTH 100
static char line[MAXLINELENGTH];
- static char *skip(), *value();
if (!tf && !setttyent())
return (NULL);
+ flockfile (tf);
for (;;) {
- if (!fgets(p = line, sizeof(line), tf))
+ if (!fgets_unlocked(p = line, sizeof(line), tf)) {
+ funlockfile (tf);
return (NULL);
+ }
/* skip lines that are too big */
if (!index(p, '\n')) {
- while ((c = getc(tf)) != '\n' && c != EOF)
+ while ((c = getc_unlocked(tf)) != '\n' && c != EOF)
;
continue;
}
if (*p && *p != '#')
break;
}
+ funlockfile(tf);
zapchar = 0;
tty.ty_name = p;
* the next field.
*/
static char *
+internal_function
skip(p)
register char *p;
{
}
static char *
+internal_function
value(p)
register char *p;
{