From 484202faab4474c1fbe2acbdd66843fbaec9e885 Mon Sep 17 00:00:00 2001 From: Joseph Koshy Date: Wed, 12 Mar 2008 15:51:32 +0000 Subject: [PATCH] Bring the behaviour of pmc_capabilities() and pmc_width() in line with documentation: set 'errno' and return -1 in case of an error. Update (c) years. --- lib/libpmc/libpmc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index e1ad3ca9985..0075f9d2736 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003-2006 Joseph Koshy + * Copyright (c) 2003-2008 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1731,7 +1731,8 @@ pmc_capabilities(pmc_id_t pmcid, uint32_t *caps) *caps = cpu_info.pm_classes[i].pm_caps; return (0); } - return (EINVAL); + errno = EINVAL; + return (-1); } int @@ -2194,7 +2195,8 @@ pmc_width(pmc_id_t pmcid, uint32_t *width) *width = cpu_info.pm_classes[i].pm_width; return (0); } - return (EINVAL); + errno = EINVAL; + return (-1); } int