summaryrefslogtreecommitdiffstats
path: root/lib/libpmc
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2008-03-12 15:51:32 +0000
committerjkoshy <jkoshy@FreeBSD.org>2008-03-12 15:51:32 +0000
commit9efc2e038a05dfaeb46eb8a0737e4a3acbfe619e (patch)
tree86730e3ffd63696a578ca8268166baf84d1080a0 /lib/libpmc
parentdc87dccab67375d3362f2ec13a5b1f670a6d2a7a (diff)
downloadFreeBSD-src-9efc2e038a05dfaeb46eb8a0737e4a3acbfe619e.zip
FreeBSD-src-9efc2e038a05dfaeb46eb8a0737e4a3acbfe619e.tar.gz
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.
Diffstat (limited to 'lib/libpmc')
-rw-r--r--lib/libpmc/libpmc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index e1ad3ca..0075f9d 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
OpenPOWER on IntegriCloud