summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2004-06-08 05:45:48 +0000
committerdas <das@FreeBSD.org>2004-06-08 05:45:48 +0000
commit9372d79f045ec7eb096615035a212fb555034516 (patch)
treecff06da273d59e0640a4dcd1273967b1e9282bbd /lib
parenta1e60d89fb009ab28b4b2d277495309756b79ff3 (diff)
downloadFreeBSD-src-9372d79f045ec7eb096615035a212fb555034516.zip
FreeBSD-src-9372d79f045ec7eb096615035a212fb555034516.tar.gz
Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects. Also, don't set errno if prepwrite() fails, since this is done in prepwrite() now.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/fvwrite.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c
index cacad7f..9cc4c55 100644
--- a/lib/libc/stdio/fvwrite.c
+++ b/lib/libc/stdio/fvwrite.c
@@ -40,7 +40,6 @@ static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -68,10 +67,8 @@ __sfvwrite(fp, uio)
if ((len = uio->uio_resid) == 0)
return (0);
/* make sure we can write */
- if (cantwrite(fp)) {
- errno = EBADF;
+ if (prepwrite(fp) != 0)
return (EOF);
- }
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n))
OpenPOWER on IntegriCloud