summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fflush.c')
-rw-r--r--lib/libc/stdio/fflush.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c
index aed57ec..f5c89e7 100644
--- a/lib/libc/stdio/fflush.c
+++ b/lib/libc/stdio/fflush.c
@@ -39,16 +39,13 @@
static char sccsid[] = "@(#)fflush.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: fflush.c,v 1.5 1997/02/22 15:01:50 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <errno.h>
#include <stdio.h>
#include "local.h"
-#ifdef _THREAD_SAFE
-#include <pthread.h>
-#include "pthread_private.h"
-#endif
+#include "libc_private.h"
/* Flush a single file, or (if fp is NULL) all files. */
int
@@ -59,18 +56,14 @@ fflush(fp)
if (fp == NULL)
return (_fwalk(__sflush));
-#ifdef _THREAD_SAFE
- _thread_flockfile(fp,__FILE__,__LINE__);
-#endif
+ FLOCKFILE(fp);
if ((fp->_flags & (__SWR | __SRW)) == 0) {
errno = EBADF;
retval = EOF;
} else {
retval = __sflush(fp);
}
-#ifdef _THREAD_SAFE
- _thread_funlockfile(fp);
-#endif
+ FUNLOCKFILE(fp);
return (retval);
}
OpenPOWER on IntegriCloud