From owner-svn-src-all@FreeBSD.ORG Sat Jun 5 22:57:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 695A1106566B; Sat, 5 Jun 2010 22:57:54 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1748FC1E; Sat, 5 Jun 2010 22:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55Mvsjv062965; Sat, 5 Jun 2010 22:57:54 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55Mvsvc062961; Sat, 5 Jun 2010 22:57:54 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201006052257.o55Mvsvc062961@svn.freebsd.org> From: Fabien Thomas Date: Sat, 5 Jun 2010 22:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208858 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 22:57:54 -0000 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))