From 92a5b2ee713dc87bfb8b96e7257635cc7b32c489 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Tue, 8 Jun 2004 05:45:48 +0000 Subject: 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. --- lib/libc/stdio/fvwrite.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c index cacad7f96d6f..9cc4c5573a68 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 __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -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)) -- cgit v1.3