Module Name:    src
Committed By:   martin
Date:           Mon Apr 16 13:31:33 UTC 2018

Modified Files:
        src/sys/kern [netbsd-8]: kern_proc.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #758):

        sys/kern/kern_proc.c: revision 1.212

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>


To generate a diff of this commit:
cvs rdiff -u -r1.206.6.3 -r1.206.6.4 src/sys/kern/kern_proc.c

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

Modified files:

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.206.6.3 src/sys/kern/kern_proc.c:1.206.6.4
--- src/sys/kern/kern_proc.c:1.206.6.3	Thu Apr 12 13:42:48 2018
+++ src/sys/kern/kern_proc.c	Mon Apr 16 13:31:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.206.6.3 2018/04/12 13:42:48 martin Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin 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.206.6.3 2018/04/12 13:42:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -1834,10 +1834,6 @@ sysctl_doeproc(SYSCTLFN_ARGS)
 	mutex_exit(proc_lock);
 
 	if (where != NULL) {
-		if (needed == 0) {
-			error = ESRCH;
-			goto out;
-		}
 		*oldlenp = dp - where;
 		if (needed > *oldlenp) {
 			error = ENOMEM;

Reply via email to