Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2012 15:27:34 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244153 - head/lib/libc/gen
Message-ID:  <201212121527.qBCFRY2F083334@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Wed Dec 12 15:27:33 2012
New Revision: 244153
URL: http://svnweb.freebsd.org/changeset/base/244153

Log:
  Eliminate redundant variable.

Modified:
  head/lib/libc/gen/sysctlbyname.c

Modified: head/lib/libc/gen/sysctlbyname.c
==============================================================================
--- head/lib/libc/gen/sysctlbyname.c	Wed Dec 12 13:33:11 2012	(r244152)
+++ head/lib/libc/gen/sysctlbyname.c	Wed Dec 12 15:27:33 2012	(r244153)
@@ -19,13 +19,10 @@ sysctlbyname(const char *name, void *old
     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));
 }



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