summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-12 01:27:09 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-12 01:27:09 +0000
commit7ee0a6a4e21e5ba57db1bfe3c3e9cf55109cd18a (patch)
treec0eb8661089a7b51d4dc1b1c0405e9adce89df1c /file_io
parent3e0b4a50bdc7c883767d65bd7258ee9be02e02d0 (diff)
downloadlibapr-7ee0a6a4e21e5ba57db1bfe3c3e9cf55109cd18a.tar.gz
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 <mturk@mappingsoft.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62952 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/unix/mktemp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/file_io/unix/mktemp.c b/file_io/unix/mktemp.c
index 3e73a655f..99a712a4f 100644
--- a/file_io/unix/mktemp.c
+++ b/file_io/unix/mktemp.c
@@ -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 @@ static int gettemp(char *path, apr_file_t **doopen, apr_int32_t flags, apr_pool_
apr_uint32_t randnum;
if (randseed==0) {
- randseed = time(NULL);
+ randseed = (int)apr_time_now();
seedrandom(randseed);
}