Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/procfs remove redundant error initialization and ...



details:   https://anonhg.NetBSD.org/src/rev/42274e01052a
branches:  trunk
changeset: 359592:42274e01052a
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Jan 11 22:55:54 2022 +0000

description:
remove redundant error initialization and break earlier. (from rvp)

diffstat:

 sys/miscfs/procfs/procfs_vnops.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r c3057e43f59f -r 42274e01052a sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c  Tue Jan 11 22:45:56 2022 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c  Tue Jan 11 22:55:54 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vnops.c,v 1.223 2022/01/11 11:10:46 hannken Exp $       */
+/*     $NetBSD: procfs_vnops.c,v 1.224 2022/01/11 22:55:54 christos Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.223 2022/01/11 11:10:46 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.224 2022/01/11 22:55:54 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1483,7 +1483,7 @@
                            M_TEMP, M_WAITOK);
                        *ap->a_cookies = cookies;
                }
-               error = 0;
+
                /* 0 ... 3 are static entries. */
                for (; i <= 3 && uio->uio_resid >= UIO_MX; i++) {
                        switch (i) {
@@ -1517,6 +1517,8 @@
                        if (cookies)
                                *cookies++ = i + 1;
                }
+               if (error)
+                       break;
                /* 4 ... are process entries. */
                ctx.uiop = uio;
                ctx.error = 0;



Home | Main Index | Thread Index | Old Index