[Glibc-bsd-commits] r4110 - in trunk: freebsd-buildutils/debian freebsd-buildutils/debian/local/include freebsd-utils/debian freebsd-utils/debian/patches

Robert Millan rmh at alioth.debian.org
Thu Feb 23 19:56:13 UTC 2012


Author: rmh
Date: 2012-02-23 19:56:13 +0000 (Thu, 23 Feb 2012)
New Revision: 4110

Modified:
   trunk/freebsd-buildutils/debian/changelog
   trunk/freebsd-buildutils/debian/local/include/unistd.h
   trunk/freebsd-utils/debian/control
   trunk/freebsd-utils/debian/patches/035_nfs.diff
Log:
Add getosreldate() to local headers.

Modified: trunk/freebsd-buildutils/debian/changelog
===================================================================
--- trunk/freebsd-buildutils/debian/changelog	2012-02-23 19:54:11 UTC (rev 4109)
+++ trunk/freebsd-buildutils/debian/changelog	2012-02-23 19:56:13 UTC (rev 4110)
@@ -1,3 +1,9 @@
+freebsd-buildutils (9.0-8) UNRELEASED; urgency=low
+
+  * Add getosreldate() to local headers.
+
+ -- Robert Millan <rmh at debian.org>  Thu, 23 Feb 2012 20:33:10 +0100
+
 freebsd-buildutils (9.0-7) unstable; urgency=low
 
   * sys/endian.h: Don't include_next <machine/endian.h>, just include.

Modified: trunk/freebsd-buildutils/debian/local/include/unistd.h
===================================================================
--- trunk/freebsd-buildutils/debian/local/include/unistd.h	2012-02-23 19:54:11 UTC (rev 4109)
+++ trunk/freebsd-buildutils/debian/local/include/unistd.h	2012-02-23 19:56:13 UTC (rev 4110)
@@ -33,7 +33,60 @@
   syscall (SYS_closefrom, lowfd);
 }
 
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
+#include <stddef.h>
+#include <sys/sysctl.h>
+#include <stdlib.h>
+
+static inline int
+getosreldate(void)
+{
+	int mib[2];
+	size_t size;
+	int value;
+	char *temp;
+
+	if ((temp = getenv("OSVERSION"))) {
+		value = atoi(temp);
+		return (value);
+	}
+
+	mib[0] = CTL_KERN;
+	mib[1] = KERN_OSRELDATE;
+	size = sizeof value;
+	if (sysctl(mib, 2, &value, &size, NULL, 0) == -1)
+		return (-1);
+	return (value);
+}
+
 /*-
  * Copyright (c) 2008 Yahoo!, Inc.
  * All rights reserved.

Modified: trunk/freebsd-utils/debian/control
===================================================================
--- trunk/freebsd-utils/debian/control	2012-02-23 19:54:11 UTC (rev 4109)
+++ trunk/freebsd-utils/debian/control	2012-02-23 19:56:13 UTC (rev 4110)
@@ -5,7 +5,7 @@
 Uploaders: Aurelien Jarno <aurel32 at debian.org>, Guillem Jover <guillem at debian.org>, Robert Millan <rmh at debian.org>
 Build-Depends: debhelper (>= 7), po-debconf, sharutils,
  flex | flex-old,
- freebsd-buildutils (>= 9.0-7~), 
+ freebsd-buildutils (>= 9.0-8~),
  kfreebsd-kernel-headers (>= 0.70),
  libc0.1-dev (>= 2.13-26),
  libbsd-dev (>= 0.3.0), pkg-config,

Modified: trunk/freebsd-utils/debian/patches/035_nfs.diff
===================================================================
--- trunk/freebsd-utils/debian/patches/035_nfs.diff	2012-02-23 19:54:11 UTC (rev 4109)
+++ trunk/freebsd-utils/debian/patches/035_nfs.diff	2012-02-23 19:56:13 UTC (rev 4110)
@@ -1,56 +1,7 @@
 --- a/sbin/mount_nfs/mount_nfs.c
 +++ b/sbin/mount_nfs/mount_nfs.c
-@@ -130,7 +130,6 @@
- 	TRYRET_LOCALERR		/* Local failure. */
- };
- 
--static int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
- static int	sec_name_to_num(char *sec);
- static char	*sec_num_to_name(int num);
- static int	getnfsargs(char *, struct iovec **iov, int *iovlen);
-@@ -150,7 +149,6 @@
- 	int c;
- 	struct iovec *iov;
- 	int mntflags, num, iovlen;
--	int osversion;
- 	char *name, *p, *spec, *fstype;
- 	char mntpath[MAXPATHLEN], errmsg[255];
- 	char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50];
-@@ -417,25 +415,14 @@
- 	build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
- 	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
- 
--	/*
--	 * XXX:
--	 * Backwards compatibility routines for older kernels.
--	 * Remove this and fallback_mount() code when we do not need to support
--	 * NFS mounts against older kernels which still need
--	 * struct nfs_args to be passed in via nmount().
--	 */
--	osversion = getosreldate();
--	if (osversion >= 702100) {
--		if (nmount(iov, iovlen, mntflags))
--			err(1, "%s, %s", mntpath, errmsg);
--	} else {
--		if (fallback_mount(iov, iovlen, mntflags))
-+        if (nmount(iov, iovlen, mntflags)) {
- 			err(1, "%s, %s", mntpath, errmsg);
- 	}
- 
- 	exit(0);
- }
- 
-+#if 0
+@@ -661,12 +661,18 @@
  static int
- findopt(struct iovec *iov, int iovlen, const char *name,
-     char **valuep, int *lenp)
-@@ -657,16 +644,23 @@
- 
- 	return nmount(newiov, newiovlen, mntflags);
- }
-+#endif
- 
- static int
  sec_name_to_num(char *sec)
  {
 +#ifdef RPCSEC_GSS_KRB5
@@ -68,7 +19,7 @@
  	if (!strcmp(sec, "sys"))
  		return (AUTH_SYS);
  	return (-1);
-@@ -676,12 +670,18 @@
+@@ -676,12 +682,18 @@
  sec_num_to_name(int flavor)
  {
  	switch (flavor) {
@@ -87,7 +38,7 @@
  	case AUTH_SYS:
  		return ("sys");
  	}
-@@ -826,9 +826,11 @@
+@@ -826,9 +838,11 @@
  	freeaddrinfo(ai_nfs);
  
  	build_iovec(iov, iovlen, "hostname", nam, (size_t)-1);




More information about the Glibc-bsd-commits mailing list