Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 May 2018 20:30:46 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334351 - head/lib/libpmc
Message-ID:  <201805292030.w4TKUkBw047172@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vangyzen
Date: Tue May 29 20:30:46 2018
New Revision: 334351
URL: https://svnweb.freebsd.org/changeset/base/334351

Log:
  pmc_annotate: adhere to the API
  
  If the 'mode' parameter was invalid, pmc_annotate() would
  return EINVAL instead of setting errno and returning -1.
  
  Sponsored by:	Dell EMC

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==============================================================================
--- head/lib/libpmc/libpmc.c	Tue May 29 20:28:34 2018	(r334350)
+++ head/lib/libpmc/libpmc.c	Tue May 29 20:30:46 2018	(r334351)
@@ -2781,7 +2781,8 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
 
 	if (mode != PMC_MODE_SS && mode != PMC_MODE_TS &&
 	    mode != PMC_MODE_SC && mode != PMC_MODE_TC) {
-		return (EINVAL);
+		errno = EINVAL;
+		goto out;
 	}
 	bzero(&pmc_config, sizeof(pmc_config));
 	pmc_config.pm_cpu   = cpu;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805292030.w4TKUkBw047172>