about summary refs log tree commit diff
path: root/lib/libpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpm.c')
-rw-r--r--lib/libpm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libpm.c b/lib/libpm.c
index df59e6c4..f36b7a50 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -35,7 +35,9 @@
 #define _LARGE_FILE_API
     /* This makes the the x64() functions available on AIX */
 
+#include <unistd.h>
 #include <stdio.h>
+#include <fcntl.h>
 #include <stdarg.h>
 #include <string.h>
 #include <errno.h>
@@ -43,6 +45,7 @@
 #ifdef __DJGPP__
   #include <io.h>
 #endif
+#include <time.h>
 
 #include "pm_c_util.h"
 #include "version.h"
@@ -782,6 +785,15 @@ pm_arg0toprogname(const char arg0[]) {
 
 
 
+unsigned int
+pm_randseed(void) {
+
+    return time(NULL) ^ getpid();
+
+}
+
+
+
 /* File open/close that handles "-" as stdin/stdout and checks errors. */
 
 FILE*
@@ -986,7 +998,7 @@ pm_make_tmpfile(FILE **       const filePP,
     const char * dirseparator;
     const char * error;
 
-    fnamelen = strlen (pm_progname) + 10; /* "/" + "_XXXXXX\0" */
+    fnamelen = strlen(pm_progname) + 10; /* "/" + "_XXXXXX\0" */
 
     tmpdir = tmpDir();