From 7497154e945b0744450ff71f025bf60276ad4066 Mon Sep 17 00:00:00 2001 From: Marc Teitelbaum Date: Tue, 2 Jul 1991 01:00:08 -0800 Subject: [PATCH] print better error message if nlist fails SCCS-vsn: bin/ps/nlist.c 5.5 --- usr/src/bin/ps/nlist.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/usr/src/bin/ps/nlist.c b/usr/src/bin/ps/nlist.c index 4ba17176ca..a749b006a9 100644 --- a/usr/src/bin/ps/nlist.c +++ b/usr/src/bin/ps/nlist.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)nlist.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)nlist.c 5.5 (Berkeley) %G%"; #endif /* not lint */ #include @@ -57,7 +57,7 @@ donlist() rval = 0; nlistread = 1; if (kvm_nlist(psnl)) { - (void)fprintf(stderr, "ps: kvm_nlist: %s\n", kvm_geterr()); + nlisterr(psnl); eval = 1; return(1); } @@ -87,3 +87,15 @@ donlist() } return(rval); } + +nlisterr(nl) + struct nlist nl[]; +{ + int i; + + fprintf(stderr, "ps: nlist: can't find following symbols:"); + for (i = 0; nl[i].n_name != NULL; i++) + if (nl[i].n_value == 0) + fprintf(stderr, " %s", nl[i].n_name); + fprintf(stderr, "\n"); +} -- 2.20.1