Module Name:    src
Committed By:   christos
Date:           Thu Jul 22 17:09:01 UTC 2021

Modified Files:
        src/lib/libc/stdio: fflush.c

Log Message:
revert changes to fflush.c (1.18) and fvwrite.c (1.25) until we investigate
collateral damage. Breaks h_intr.c test. Requested by RVP.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/stdio/fflush.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdio/fflush.c
diff -u src/lib/libc/stdio/fflush.c:1.23 src/lib/libc/stdio/fflush.c:1.24
--- src/lib/libc/stdio/fflush.c:1.23	Fri Jul  9 05:24:16 2021
+++ src/lib/libc/stdio/fflush.c	Thu Jul 22 13:09:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $	*/
+/*	$NetBSD: fflush.c,v 1.24 2021/07/22 17:09:01 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.23 2021/07/09 09:24:16 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.24 2021/07/22 17:09:01 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,8 +45,6 @@ __RCSID("$NetBSD: fflush.c,v 1.23 2021/0
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>
-#include <string.h>
-
 #include "reentrant.h"
 #include "local.h"
 
@@ -107,18 +105,7 @@ __sflush(FILE *fp)
 
 	for (; n > 0; n -= t, p += t) {
 		t = (*fp->_write)(fp->_cookie, (char *)p, n);
-		if (t == 0)
-			goto out;
-		if (t < 0) {
-			/* Reset _p and _w. */
-			if (p > fp->_p) {
-				/* Some was written. */
-				memmove(fp->_p, p, n);
-			}
-			fp->_p += n;
-			if ((fp->_flags & (__SLBF | __SNBF)) == 0)
-				fp->_w -= n;
-out:
+		if (t <= 0) {
 			fp->_flags |= __SERR;
 			return EOF;
 		}

Reply via email to