[Glibc-bsd-commits] r4487 - trunk/glibc-ports/kfreebsd

Petr Salinger ps-guest at alioth.debian.org
Thu May 30 08:21:12 UTC 2013


Author: ps-guest
Date: 2013-05-30 08:21:12 +0000 (Thu, 30 May 2013)
New Revision: 4487

Modified:
   trunk/glibc-ports/kfreebsd/dl-sysdep.c
Log:
reflect changes in version scheme of __FreeBSD_version



Modified: trunk/glibc-ports/kfreebsd/dl-sysdep.c
===================================================================
--- trunk/glibc-ports/kfreebsd/dl-sysdep.c	2013-05-28 19:59:24 UTC (rev 4486)
+++ trunk/glibc-ports/kfreebsd/dl-sysdep.c	2013-05-30 08:21:12 UTC (rev 4487)
@@ -235,19 +235,27 @@
   int request[2] = { CTL_KERN, KERN_OSRELDATE };
   size_t len;
   int version;
+  int subrelease;
 
   len = sizeof(version);
   if (__sysctl (request, 2, &version, &len, NULL, 0) < 0)
     return -1;
     
 /*
- *   scheme is:  <major><two digit minor>Rxx
- *		'R' is 0 if release branch or x.0-CURRENT before RELENG_*_0
- *		is created, otherwise 1.
+ * since 8.0 release
+ * scheme is:  <major><two digit minor>Rxx
+ *              'R' is in the range 0 to 4 if this is a release branch or
+ *              x.0-CURRENT before RELENG_*_0 is created, otherwise 'R' is
+ *              in the range 5 to 9.
  */
 
   /* Convert to the GLIBC versioning system */
+  subrelease = version % 1000;
+  if (subrelease >= 500)
+      subrelease -= 300;	/* hopefull 55 values suffice for stable update */
+  if (subrelease > 255)		/* it have to fit into byte */
+      subrelease = 255;
   return ((version / 100000) << 16)		/* major */
 	 | (((version % 100000) / 1000) << 8)   /* minor 	0 -  99 */
-	 | ((version % 200));			/* subrelease 	0 - 199 */
+	 | subrelease;
 }




More information about the Glibc-bsd-commits mailing list