Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Don't set errno ESRCH for empty result of KINFO_PRO...



details:   https://anonhg.NetBSD.org/src/rev/94766505e229
branches:  trunk
changeset: 361141:94766505e229
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Apr 14 14:26:20 2018 +0000

description:
Don't set errno ESRCH for empty result of KINFO_PROC[2]

Restore the previous behavior as it's prefered.

This new behavior was introduced in 1.210.

Code should check for length of the result.

Requested by <mlelstv>

diffstat:

 sys/kern/kern_proc.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r 07ddae33b05a -r 94766505e229 sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c      Sat Apr 14 08:13:58 2018 +0000
+++ b/sys/kern/kern_proc.c      Sat Apr 14 14:26:20 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_proc.c,v 1.211 2018/03/13 02:24:26 kamil Exp $    */
+/*     $NetBSD: kern_proc.c,v 1.212 2018/04/14 14:26:20 kamil Exp $    */
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.211 2018/03/13 02:24:26 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.212 2018/04/14 14:26:20 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -1834,10 +1834,6 @@
        mutex_exit(proc_lock);
 
        if (where != NULL) {
-               if (needed == 0) {
-                       error = ESRCH;
-                       goto out;
-               }
                *oldlenp = dp - where;
                if (needed > *oldlenp) {
                        error = ENOMEM;



Home | Main Index | Thread Index | Old Index