summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-12-12 15:27:33 +0000
committerpjd <pjd@FreeBSD.org>2012-12-12 15:27:33 +0000
commitdddecfb2fbb9da35ba472f32182b6707381d55c7 (patch)
treeba4402cf065c17c5ec8d26eb8ddba09c53aae8f3
parent54156ad826f67692c62d4f486b3236bbe6b658ba (diff)
downloadFreeBSD-src-dddecfb2fbb9da35ba472f32182b6707381d55c7.zip
FreeBSD-src-dddecfb2fbb9da35ba472f32182b6707381d55c7.tar.gz
Eliminate redundant variable.
-rw-r--r--lib/libc/gen/sysctlbyname.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/gen/sysctlbyname.c b/lib/libc/gen/sysctlbyname.c
index a2e0d5f..88b860d 100644
--- a/lib/libc/gen/sysctlbyname.c
+++ b/lib/libc/gen/sysctlbyname.c
@@ -19,13 +19,10 @@ sysctlbyname(const char *name, void *oldp, size_t *oldlenp,
const void *newp, size_t newlen)
{
int real_oid[CTL_MAXNAME+2];
- int error;
size_t oidlen;
oidlen = sizeof(real_oid) / sizeof(int);
- error = sysctlnametomib(name, real_oid, &oidlen);
- if (error < 0)
- return (error);
- error = sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen);
- return (error);
+ if (sysctlnametomib(name, real_oid, &oidlen) < 0)
+ return (-1);
+ return (sysctl(real_oid, oidlen, oldp, oldlenp, newp, newlen));
}
OpenPOWER on IntegriCloud