diff options
| author | John Birrell <jb@FreeBSD.org> | 1998-04-11 07:40:47 +0000 |
|---|---|---|
| committer | John Birrell <jb@FreeBSD.org> | 1998-04-11 07:40:47 +0000 |
| commit | ec216c263498f3ab7c5554f5c5571125b57024b8 (patch) | |
| tree | e65c59eb392b5a151bd78ac3768fcc00c26b4e6e /lib/libc/stdio/vfprintf.c | |
| parent | af3c7c8d85b67eb82f9391b60743091a227323a1 (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
| -rw-r--r-- | lib/libc/stdio/vfprintf.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index dd3f743d5ff4..5a3a25be9511 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id: vfprintf.c,v 1.16 1997/12/25 00:32:17 ache Exp $"; + "$Id: vfprintf.c,v 1.17 1998/01/04 22:28:47 ache Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -63,10 +63,7 @@ static const char rcsid[] = #include "local.h" #include "fvwrite.h" -#ifdef _THREAD_SAFE -#include <pthread.h> -#include "pthread_private.h" -#endif +#include "libc_private.h" /* Define FLOATING_POINT to get floating point. */ #define FLOATING_POINT @@ -421,23 +418,17 @@ vfprintf(fp, fmt0, ap) } -#ifdef _THREAD_SAFE - _thread_flockfile(fp,__FILE__,__LINE__); -#endif + FLOCKFILE(fp); /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ if (cantwrite(fp)) { -#ifdef _THREAD_SAFE - _thread_funlockfile(fp); -#endif + FUNLOCKFILE(fp); return (EOF); } /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) { -#ifdef _THREAD_SAFE - _thread_funlockfile(fp); -#endif + FUNLOCKFILE(fp); return (__sbprintf(fp, fmt0, ap)); } @@ -873,9 +864,7 @@ done: error: if (__sferror(fp)) ret = EOF; -#ifdef _THREAD_SAFE - _thread_funlockfile(fp); -#endif + FUNLOCKFILE(fp); if ((argtable != NULL) && (argtable != statargtable)) free (argtable); return (ret); |
