diff options
Diffstat (limited to 'libc/stdio/fpurge.c')
-rw-r--r-- | libc/stdio/fpurge.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/stdio/fpurge.c b/libc/stdio/fpurge.c index fa0213ac7..e04c4fefc 100644 --- a/libc/stdio/fpurge.c +++ b/libc/stdio/fpurge.c @@ -43,7 +43,9 @@ int fpurge(FILE *fp) { + FLOCKFILE(fp); if (!fp->_flags) { + FUNLOCKFILE(fp); errno = EBADF; return(EOF); } @@ -54,5 +56,6 @@ fpurge(FILE *fp) fp->_p = fp->_bf._base; fp->_r = 0; fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size; + FUNLOCKFILE(fp); return (0); } |