summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/sysctl.c')
-rw-r--r--lib/libc/gen/sysctl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index cb7448a..19709d5 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -66,16 +66,20 @@ sysctl(name, namelen, oldp, oldlenp, newp, newlen)
switch (name[1]) {
case USER_CS_PATH:
- if (oldp && *oldlenp < sizeof(_PATH_STDPATH))
- return (ENOMEM);
+ if (oldp && *oldlenp < sizeof(_PATH_STDPATH)) {
+ errno = ENOMEM;
+ return -1;
+ }
*oldlenp = sizeof(_PATH_STDPATH);
if (oldp != NULL)
memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH));
return (0);
}
- if (oldp && *oldlenp < sizeof(int))
- return (ENOMEM);
+ if (oldp && *oldlenp < sizeof(int)) {
+ errno = ENOMEM;
+ return (-1);
+ }
*oldlenp = sizeof(int);
if (oldp == NULL)
return (0);
OpenPOWER on IntegriCloud