wrowe 02/02/11 17:27:09
Modified: file_io/unix mktemp.c
Log:
I hope the clocks have sufficient resolution to make this randomization
useful. Comments? We may need to divide, not necessarily by USEC_PER_SEC
but perhaps by a nice binary value.
Submitted by: Mladen Turk <[EMAIL PROTECTED]>
Revision Changes Path
1.21 +7 -1 apr/file_io/unix/mktemp.c
Index: mktemp.c
===================================================================
RCS file: /home/cvs/apr/file_io/unix/mktemp.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- mktemp.c 18 Jan 2002 19:16:29 -0000 1.20
+++ mktemp.c 12 Feb 2002 01:27:09 -0000 1.21
@@ -106,9 +106,15 @@
#define seedrandom(a) srandom(a)
#endif
+#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#if APR_HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#if APR_HAVE_FCNTL_H
#include <fcntl.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -130,7 +136,7 @@
apr_uint32_t randnum;
if (randseed==0) {
- randseed = time(NULL);
+ randseed = (int)apr_time_now();
seedrandom(randseed);
}