aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/lrand48.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/lrand48.c')
-rw-r--r--lib/libc/gen/lrand48.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/gen/lrand48.c b/lib/libc/gen/lrand48.c
index a3d0111cf4d5..cc07044b8af9 100644
--- a/lib/libc/gen/lrand48.c
+++ b/lib/libc/gen/lrand48.c
@@ -13,11 +13,9 @@
#include "rand48.h"
-extern unsigned short _rand48_seed[3];
-
long
lrand48(void)
{
- _dorand48(_rand48_seed);
- return ((long) _rand48_seed[2] << 15) + ((long) _rand48_seed[1] >> 1);
+ _DORAND48(_rand48_seed);
+ return (_rand48_seed >> 17) & 0x7fffffff;
}