summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-08-13 17:49:45 +0000
committerpeter <peter@FreeBSD.org>1996-08-13 17:49:45 +0000
commit8542445a70b5accf790f1ebb2d915ac459ceadb6 (patch)
treebe28ef4b78cd8e42bb1260b077c110d69b4f5bbe /lib/libc
parent3ba537ecfe2ab1290c1a9710fd0766979614ce7a (diff)
downloadFreeBSD-src-8542445a70b5accf790f1ebb2d915ac459ceadb6.zip
FreeBSD-src-8542445a70b5accf790f1ebb2d915ac459ceadb6.tar.gz
Fix nasty bracketing/precedence bug. Every time something read (and
refilled) a file that was either line- or un-buffered, all files were flushed. According to the code comment, the flush (according to ANSI) is supposed to happen on write + line buffered output files, not _all_ files. Obtained from: OpenBSD / Theo de Raadt, possibly from proven@cygnus.com
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/refill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c
index d30194f..845e0e6 100644
--- a/lib/libc/stdio/refill.c
+++ b/lib/libc/stdio/refill.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)refill.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: refill.c,v 1.3 1996/06/22 10:33:45 jraynard Exp $";
#endif /* LIBC_SCCS and not lint */
#include <errno.h>
@@ -54,7 +54,7 @@ lflush(fp)
FILE *fp;
{
- if ((fp->_flags & (__SLBF|__SWR)) == __SLBF|__SWR)
+ if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
return (__sflush(fp));
return (0);
}
OpenPOWER on IntegriCloud