summaryrefslogtreecommitdiff
path: root/lib/sh/tmpfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/tmpfile.c')
-rw-r--r--lib/sh/tmpfile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sh/tmpfile.c b/lib/sh/tmpfile.c
index c06ad657..d42d1807 100644
--- a/lib/sh/tmpfile.c
+++ b/lib/sh/tmpfile.c
@@ -2,7 +2,7 @@
* tmpfile.c - functions to create and safely open temp files for the shell.
*/
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -47,6 +47,11 @@ extern int errno;
#define DEFAULT_TMPDIR "." /* bogus default, should be changed */
#define DEFAULT_NAMEROOT "shtmp"
+/* Use ANSI-C rand() interface if random(3) is not available */
+#if !HAVE_RANDOM
+#define random() rand()
+#endif
+
extern pid_t dollar_dollar_pid;
static char *get_sys_tmpdir __P((void));