Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Return ENOENT if the hashstat sysctl was called to ...



details:   https://anonhg.NetBSD.org/src/rev/9ab7ab1a2848
branches:  trunk
changeset: 983910:9ab7ab1a2848
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sun Jun 13 14:58:49 2021 +0000

description:
Return ENOENT if the hashstat sysctl was called to query a specific hash
name and that hash name doesn't exist.

diffstat:

 sys/kern/subr_hash.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 60e25230e590 -r 9ab7ab1a2848 sys/kern/subr_hash.c
--- a/sys/kern/subr_hash.c      Sun Jun 13 14:48:10 2021 +0000
+++ b/sys/kern/subr_hash.c      Sun Jun 13 14:58:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_hash.c,v 1.11 2021/06/13 14:02:46 christos Exp $  */
+/*     $NetBSD: subr_hash.c,v 1.12 2021/06/13 14:58:49 simonb Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.11 2021/06/13 14:02:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.12 2021/06/13 14:58:49 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -243,6 +243,9 @@
        rw_exit(&hashstat_lock);
        sysctl_relock();
 
+       if (query && written == 0)      /* query not found? */
+               error = ENOENT;
+
        *oldlenp = written;
        return error;
 }



Home | Main Index | Thread Index | Old Index