aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/fvwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fvwrite.c')
-rw-r--r--lib/libc/stdio/fvwrite.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/libc/stdio/fvwrite.c b/lib/libc/stdio/fvwrite.c
index 2a161859afa9..2d5aaf3c5dc8 100644
--- a/lib/libc/stdio/fvwrite.c
+++ b/lib/libc/stdio/fvwrite.c
@@ -32,12 +32,6 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fvwrite.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -54,7 +48,6 @@ int
__sfvwrite(FILE *fp, struct __suio *uio)
{
size_t len;
- unsigned char *old_p;
char *p;
struct __siov *iov;
int w, s;
@@ -138,12 +131,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
COPY(w);
/* fp->_w -= w; */ /* unneeded */
fp->_p += w;
- old_p = fp->_p;
- if (__fflush(fp) == EOF) {
- if (old_p == fp->_p)
- fp->_p -= w;
+ if (__fflush(fp))
goto err;
- }
} else if (len >= (w = fp->_bf._size)) {
/* write directly */
w = _swrite(fp, p, w);
@@ -182,12 +171,8 @@ __sfvwrite(FILE *fp, struct __suio *uio)
COPY(w);
/* fp->_w -= w; */
fp->_p += w;
- old_p = fp->_p;
- if (__fflush(fp) == EOF) {
- if (old_p == fp->_p)
- fp->_p -= w;
+ if (__fflush(fp))
goto err;
- }
} else if (s >= (w = fp->_bf._size)) {
w = _swrite(fp, p, w);
if (w <= 0)