Loading...
--- Libc/Libc-391.1.21/stdio/FreeBSD/wsetup.c
+++ Libc/Libc-320/stdio/FreeBSD/wsetup.c
@@ -38,9 +38,8 @@
static char sccsid[] = "@(#)wsetup.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/wsetup.c,v 1.9 2004/06/08 05:44:52 das Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/wsetup.c,v 1.8 2002/03/22 21:53:04 obrien Exp $");
-#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "local.h"
@@ -48,7 +47,7 @@
/*
* Various output routines call wsetup to be sure it is safe to write,
* because either _flags does not include __SWR, or _buf is NULL.
- * _wsetup returns 0 if OK to write; otherwise, it returns EOF and sets errno.
+ * _wsetup returns 0 if OK to write, nonzero otherwise.
*/
int
__swsetup(fp)
@@ -62,10 +61,8 @@
* If we are not writing, we had better be reading and writing.
*/
if ((fp->_flags & __SWR) == 0) {
- if ((fp->_flags & __SRW) == 0) {
- errno = EBADF;
+ if ((fp->_flags & __SRW) == 0)
return (EOF);
- }
if (fp->_flags & __SRD) {
/* clobber any ungetc data */
if (HASUB(fp))