From eb27c43f02ec7890c19f424de458df903745db5d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 5 Jul 1998 08:24:43 +0000 Subject: Update. 1998-05-23 Philip Blundell * sysdeps/unix/sysv/linux/arm/syscalls.list: Add `syscall'. * sysdeps/unix/sysv/linux/arm/syscall.S: Deleted. 1998-07-05 Ulrich Drepper * misc/getttyent.c (getttyent): Explicitly lock the FILE and use _unlocked functions. * inet/ruserpass.c (ruserpass): Use _unlocked functions since this is a private FILE. --- misc/getttyent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'misc/getttyent.c') diff --git a/misc/getttyent.c b/misc/getttyent.c index 6743ac5..f474cdc 100644 --- a/misc/getttyent.c +++ b/misc/getttyent.c @@ -71,12 +71,13 @@ getttyent() if (!tf && !setttyent()) return (NULL); + flockfile (tf); for (;;) { if (!fgets(p = line, sizeof(line), 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; } @@ -85,6 +86,7 @@ getttyent() if (*p && *p != '#') break; } + funlockfile(tf); zapchar = 0; tty.ty_name = p; -- cgit v1.1