From 6e6dfbf26e26b4dc46bc0951f7316ecfe92e1f04 Mon Sep 17 00:00:00 2001 From: "Wojciech A. Koszek" Date: Wed, 20 Sep 2006 12:09:21 +0000 Subject: [PATCH] Don't forget to set internal error message in kvm_nlist(). Approved by: cognet (mentor) --- lib/libkvm/kvm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 1bea13c4dc6c..e436bf2107d4 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -307,6 +307,7 @@ kvm_nlist(kd, nl) struct nlist *p; int nvalid; struct kld_sym_lookup lookup; + int error; /* * If we can't use the kld symbol lookup, revert to the @@ -339,9 +340,13 @@ kvm_nlist(kd, nl) } } /* - * Return the number of entries that weren't found. + * Return the number of entries that weren't found. If they exist, + * also fill internal error buffer. */ - return ((p - nl) - nvalid); + error = ((p - nl) - nvalid); + if (error) + _kvm_syserr(kd, kd->program, "kvm_nlist"); + return (error); } ssize_t