Module Name:    src
Committed By:   christos
Date:           Mon Jul 19 10:00:33 UTC 2021

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

Log Message:
There's no need to adjust `iov' in the error path.
Returning the amount written is all that's needed.
from RVP


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdio/fvwrite.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/fvwrite.c
diff -u src/lib/libc/stdio/fvwrite.c:1.28 src/lib/libc/stdio/fvwrite.c:1.29
--- src/lib/libc/stdio/fvwrite.c:1.28	Fri Jul 16 08:34:10 2021
+++ src/lib/libc/stdio/fvwrite.c	Mon Jul 19 06:00:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $	*/
+/*	$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.28 2021/07/16 12:34:10 christos Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.29 2021/07/19 10:00:32 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: fvwrite.c,v 1.28 2021/
 #include "fvwrite.h"
 
 static int
-flush_adj(FILE *fp, struct __suio *uio, struct __siov *iov, ssize_t w)
+flush_adj(FILE *fp, struct __suio *uio, ssize_t w)
 {
 	int rc;
 
@@ -74,7 +74,6 @@ flush_adj(FILE *fp, struct __suio *uio, 
 
 		/* adjust amt. written */
 		uio->uio_resid -= i;
-		iov->iov_len -= i;
 	} else {
 		/* only old stuff was written */
 
@@ -136,7 +135,7 @@ __sfvwrite(FILE *fp, struct __suio *uio)
 	if (w <= 0) \
 		goto err
 #define FLUSH(nw) \
-	if (flush_adj(fp, uio, iov - 1, nw)) \
+	if (flush_adj(fp, uio, nw)) \
 		goto err
 
 	if (fp->_flags & __SNBF) {

Reply via email to