pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/libkver o Allow use if sysctl for MIBs shorte...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d980e01f39ab
branches: trunk
changeset: 477606:d980e01f39ab
user: cube <cube%pkgsrc.org@localhost>
date: Tue Jul 06 09:45:38 2004 +0000
description:
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:
pkgtools/libkver/Makefile | 4 ++--
pkgtools/libkver/files/lib/kver.c | 12 ++++--------
2 files changed, 6 insertions(+), 10 deletions(-)
diffs (54 lines):
diff -r 349a5b09d73b -r d980e01f39ab pkgtools/libkver/Makefile
--- a/pkgtools/libkver/Makefile Tue Jul 06 09:06:37 2004 +0000
+++ b/pkgtools/libkver/Makefile Tue Jul 06 09:45:38 2004 +0000
@@ -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_CHECKSUM= # defined
NO_MTREE= # defined
-VERSION= 0.4
+VERSION= 0.5
ONLY_FOR_PLATFORM= NetBSD-*-*
diff -r 349a5b09d73b -r d980e01f39ab pkgtools/libkver/files/lib/kver.c
--- a/pkgtools/libkver/files/lib/kver.c Tue Jul 06 09:06:37 2004 +0000
+++ b/pkgtools/libkver/files/lib/kver.c Tue Jul 06 09:45:38 2004 +0000
@@ -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 @@
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 @@
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);
Home |
Main Index |
Thread Index |
Old Index