svn commit: r252668 - head/lib/libc/stdlib

Andrey A. Chernov ache at FreeBSD.org
Thu Jul 4 00:02:11 UTC 2013


Author: ache
Date: Thu Jul  4 00:02:10 2013
New Revision: 252668
URL: http://svnweb.freebsd.org/changeset/base/252668

Log:
  After fixing ranges restore POSIX requirement: rand() call without
  srand() must be the same as srand(1); rand();
  (yet one increment)

Modified:
  head/lib/libc/stdlib/rand.c

Modified: head/lib/libc/stdlib/rand.c
==============================================================================
--- head/lib/libc/stdlib/rand.c	Thu Jul  4 00:00:59 2013	(r252667)
+++ head/lib/libc/stdlib/rand.c	Thu Jul  4 00:02:10 2013	(r252668)
@@ -99,7 +99,12 @@ rand_r(unsigned int *ctx)
 }
 
 
-static u_long next = 1;
+static u_long next =
+#ifdef  USE_WEAK_SEEDING
+    1;
+#else
+    2;
+#endif
 
 int
 rand()


More information about the svn-src-head mailing list