about summary refs log tree commit diff
path: root/sysdeps/posix/mktemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/mktemp.c')
-rw-r--r--sysdeps/posix/mktemp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/posix/mktemp.c b/sysdeps/posix/mktemp.c
index 6bbc4c0ce9..ad5cb1daf5 100644
--- a/sysdeps/posix/mktemp.c
+++ b/sysdeps/posix/mktemp.c
@@ -35,7 +35,7 @@ mktemp (template)
 {
   static const char letters[]
     = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
-  static uint32_t value;
+  static uint64_t value;
   struct timeval tv;
   char *XXXXXX;
   size_t len;
@@ -53,12 +53,12 @@ mktemp (template)
 
   /* Get some more or less random data.  */
   __gettimeofday (&tv, NULL);
-  value += tv.tv_usec | getpid ();
+  value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
 
   for (count = 0; count < TMP_MAX; ++count)
     {
       struct stat ignored;
-      uint32_t v = value;
+      uint64_t v = value;
 
       /* Fill in the random bits.  */
       XXXXXX[0] = letters[v % 62];