aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index e060f027e83..1510930c9c1 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -60,11 +60,12 @@ With argument t, set the random number seed from the current time and pid.")
60 (limit) 60 (limit)
61 Lisp_Object limit; 61 Lisp_Object limit;
62{ 62{
63 int val; 63 EMACS_INT val;
64 Lisp_Object lispy_val;
64 unsigned long denominator; 65 unsigned long denominator;
65 66
66 if (EQ (limit, Qt)) 67 if (EQ (limit, Qt))
67 seed_random (getpid () + time (0)); 68 seed_random (getpid () + time (NULL));
68 if (NATNUMP (limit) && XFASTINT (limit) != 0) 69 if (NATNUMP (limit) && XFASTINT (limit) != 0)
69 { 70 {
70 /* Try to take our random number from the higher bits of VAL, 71 /* Try to take our random number from the higher bits of VAL,
@@ -81,7 +82,8 @@ With argument t, set the random number seed from the current time and pid.")
81 } 82 }
82 else 83 else
83 val = get_random (); 84 val = get_random ();
84 return make_number (val); 85 XSETINT (lispy_val, val);
86 return lispy_val;
85} 87}
86 88
87/* Random data-structure functions */ 89/* Random data-structure functions */