Date: Sat, 5 Jun 2010 22:57:54 +0000 (UTC) From: Fabien Thomas <fabient@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208858 - head/usr.sbin/pmcstat Message-ID: <201006052257.o55Mvsvc062961@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: fabient Date: Sat Jun 5 22:57:53 2010 New Revision: 208858 URL: http://svn.freebsd.org/changeset/base/208858 Log: Fix warnings found by Coverity. Found with: Coverity Prevent(tm) MFC after: 1 month Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Sat Jun 5 21:39:52 2010 (r208857) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Sat Jun 5 22:57:53 2010 (r208858) @@ -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: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Sat Jun 5 21:39:52 2010 (r208857) +++ head/usr.sbin/pmcstat/pmcstat.c Sat Jun 5 22:57:53 2010 (r208858) @@ -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: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Sat Jun 5 21:39:52 2010 (r208857) +++ head/usr.sbin/pmcstat/pmcstat_log.c Sat Jun 5 22:57:53 2010 (r208858) @@ -1957,6 +1957,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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006052257.o55Mvsvc062961>