svn commit: r210814 - stable/7/usr.sbin/pmcstat
Fabien Thomas
fabient at FreeBSD.org
Tue Aug 3 16:23:47 UTC 2010
Author: fabient
Date: Tue Aug 3 16:23:46 2010
New Revision: 210814
URL: http://svn.freebsd.org/changeset/base/210814
Log:
MFC r208858:
Fix warnings found by Coverity.
Found with: Coverity Prevent(tm)
Modified:
stable/7/usr.sbin/pmcstat/pmcpl_calltree.c
stable/7/usr.sbin/pmcstat/pmcstat.c
stable/7/usr.sbin/pmcstat/pmcstat_log.c
Directory Properties:
stable/7/usr.sbin/pmcstat/ (props changed)
Modified: stable/7/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Tue Aug 3 16:21:49 2010 (r210813)
+++ stable/7/usr.sbin/pmcstat/pmcpl_calltree.c Tue Aug 3 16:23:46 2010 (r210814)
@@ -896,10 +896,12 @@ pmcpl_ct_node_printchild(struct pmcpl_ct
/* Call address, line, sample. */
addr = ct->pct_image->pi_vaddr + ct->pct_func;
line = 0;
- pmcstat_image_addr2line(ct->pct_image, addr, sourcefile,
+ if (pmcstat_image_addr2line(ct->pct_image, addr, sourcefile,
sizeof(sourcefile), &line,
- funcname, sizeof(funcname));
- fprintf(args.pa_graphfile, "%p %u", (void *)addr, line);
+ funcname, sizeof(funcname)))
+ fprintf(args.pa_graphfile, "%p %u", (void *)addr, line);
+ else
+ fprintf(args.pa_graphfile, "* *");
}
else
fprintf(args.pa_graphfile, "* *");
Modified: stable/7/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- stable/7/usr.sbin/pmcstat/pmcstat.c Tue Aug 3 16:21:49 2010 (r210813)
+++ stable/7/usr.sbin/pmcstat/pmcstat.c Tue Aug 3 16:23:46 2010 (r210814)
@@ -292,7 +292,8 @@ pmcstat_find_targets(const char *spec)
0, &nproc)) == NULL)
err(EX_OSERR, "ERROR: Cannot get process list: %s",
kvm_geterr(pmcstat_kvm));
- }
+ } else
+ nproc = 0;
if ((rv = regcomp(®, spec, REG_EXTENDED|REG_NOSUB)) != 0) {
regerror(rv, ®, errbuf, sizeof(errbuf));
Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c
==============================================================================
--- stable/7/usr.sbin/pmcstat/pmcstat_log.c Tue Aug 3 16:21:49 2010 (r210813)
+++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Tue Aug 3 16:23:46 2010 (r210814)
@@ -1959,6 +1959,7 @@ pmcstat_keypress_log(void)
case 'q':
wprintw(w, "exiting...");
ret = 1;
+ break;
default:
if (plugins[args.pa_plugin].pl_topkeypress != NULL)
if (plugins[args.pa_plugin].pl_topkeypress(c, w))
More information about the svn-src-stable-7
mailing list