Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdio There's no need to adjust `iov' in the error ...



details:   https://anonhg.NetBSD.org/src/rev/bbf2700380c2
branches:  trunk
changeset: 1022445:bbf2700380c2
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 19 10:00:32 2021 +0000

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

diffstat:

 lib/libc/stdio/fvwrite.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r f63a703ecf16 -r bbf2700380c2 lib/libc/stdio/fvwrite.c
--- a/lib/libc/stdio/fvwrite.c  Mon Jul 19 01:34:03 2021 +0000
+++ b/lib/libc/stdio/fvwrite.c  Mon Jul 19 10:00:32 2021 +0000
@@ -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 @@
 #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 @@
 
                /* adjust amt. written */
                uio->uio_resid -= i;
-               iov->iov_len -= i;
        } else {
                /* only old stuff was written */
 
@@ -136,7 +135,7 @@
        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) {



Home | Main Index | Thread Index | Old Index