From d7c34a15b8684c6d9333e40ee8de208dfd3ae3e3 Mon Sep 17 00:00:00 2001 From: fabient Date: Wed, 14 Apr 2010 21:53:27 +0000 Subject: Move fatal error at the right place. Fix exit from top mode when checking if PMC is available. MFC after: 3 days --- usr.sbin/pmcstat/pmcpl_gprof.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.sbin/pmcstat/pmcpl_gprof.c') diff --git a/usr.sbin/pmcstat/pmcpl_gprof.c b/usr.sbin/pmcstat/pmcpl_gprof.c index 9327eb9..2027ecf 100644 --- a/usr.sbin/pmcstat/pmcpl_gprof.c +++ b/usr.sbin/pmcstat/pmcpl_gprof.c @@ -171,6 +171,8 @@ pmcstat_gmon_create_name(const char *samplesdir, struct pmcstat_image *image, char fullpath[PATH_MAX]; pmcname = pmcstat_pmcid_to_name(pmcid); + if (!pmcname) + err(EX_SOFTWARE, "ERROR: cannot find pmcid"); (void) snprintf(fullpath, sizeof(fullpath), "%s/%s/%s", samplesdir, pmcname, -- cgit v1.1