diff options
Diffstat (limited to 'misc/getttyent.c')
-rw-r--r-- | misc/getttyent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/getttyent.c b/misc/getttyent.c index 07018f7..e886e58 100644 --- a/misc/getttyent.c +++ b/misc/getttyent.c @@ -73,8 +73,10 @@ getttyent() return (NULL); flockfile (tf); for (;;) { - if (!fgets_unlocked(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_unlocked(tf)) != '\n' && c != EOF) |