summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorcube <cube@pkgsrc.org>2004-07-06 09:45:38 +0000
committercube <cube@pkgsrc.org>2004-07-06 09:45:38 +0000
commit28792806d7fb4fbe1201dcf381b64c569ada21ac (patch)
tree31ee2606f1d935145f82fb5e3bf13214a42db179 /pkgtools
parent122695dd38c537082c0528d1cfb6a43fd0b6c6c0 (diff)
downloadpkgsrc-28792806d7fb4fbe1201dcf381b64c569ada21ac.tar.gz
o Allow use if sysctl for MIBs shorter or longer than 2
o Instead of returning an error, pass the control to the actual call. This avoids a failure in make because of broken uname() when libkver is used. OK'd by seb@.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/libkver/Makefile4
-rw-r--r--pkgtools/libkver/files/lib/kver.c12
2 files changed, 6 insertions, 10 deletions
diff --git a/pkgtools/libkver/Makefile b/pkgtools/libkver/Makefile
index 6c4a57394e3..e6406b4cf27 100644
--- a/pkgtools/libkver/Makefile
+++ b/pkgtools/libkver/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2004/01/19 13:38:28 jmmv Exp $
+# $NetBSD: Makefile,v 1.11 2004/07/06 09:45:38 cube Exp $
DISTNAME= libkver-${VERSION}
CATEGORIES= pkgtools
@@ -18,7 +18,7 @@ NO_PKGTOOLS_REQD_CHECK= # defined
NO_CHECKSUM= # defined
NO_MTREE= # defined
-VERSION= 0.4
+VERSION= 0.5
ONLY_FOR_PLATFORM= NetBSD-*-*
diff --git a/pkgtools/libkver/files/lib/kver.c b/pkgtools/libkver/files/lib/kver.c
index 9e16d8e2fda..cf4354b0f31 100644
--- a/pkgtools/libkver/files/lib/kver.c
+++ b/pkgtools/libkver/files/lib/kver.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kver.c,v 1.4 2003/12/13 17:45:59 seb Exp $ */
+/* $NetBSD: kver.c,v 1.5 2004/07/06 09:45:38 cube Exp $ */
#include <sys/types.h>
#include <sys/param.h>
@@ -157,15 +157,11 @@ sysctl(int *name, u_int namelen, void *oldp, size_t * oldlenp, const void *newp,
if (newp != (void *) NULL)
goto real;
- if (namelen != 2) {
- errno = EINVAL;
- return (-1);
- }
if (KVER_NOT_INITIALIZED)
kver_initialize();
- if (KVER_BADLY_INITIALIZED)
- return -1;
+ if (KVER_BADLY_INITIALIZED || namelen != 2)
+ goto real;
if (name[0] == CTL_KERN) {
size_t len;
@@ -201,7 +197,7 @@ uname(struct utsname * n)
kver_initialize();
if (KVER_BADLY_INITIALIZED)
- return -1;
+ return _uname(n);
(void) strncpy(n->sysname, real_utsname.sysname, _SYS_NMLN);
(void) strncpy(n->nodename, real_utsname.nodename, _SYS_NMLN);