summaryrefslogtreecommitdiff
path: root/libc/misc/internals
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-06-18 06:25:22 +0000
committerEric Andersen <andersen@codepoet.org>2002-06-18 06:25:22 +0000
commitb9e9d181dfd86a154aa2c710d5e6b9c284b01894 (patch)
tree3401ed8d924e12130caa1544047a2120b985ed41 /libc/misc/internals
parentb34e006872e0c6c6f851ca36eda46d01e3ca0e6b (diff)
Some commentary
-Erik
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/tempname.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index 573305162..31b16c18a 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -127,15 +127,14 @@ static const char letters[] =
We use a clever algorithm to get hard-to-predict names. */
int __gen_tempname (char *tmpl, int kind)
{
- int len;
char *XXXXXX;
- static uint64_t value;
struct timeval tv;
uint32_t high, low, rh;
unsigned int k;
- int count, fd;
- int save_errno = errno;
- int i;
+ int len, i, count, fd, save_errno = errno;
+ static uint64_t value; /* Do not initialize this,
+ or lock it for multi-threaded
+ apps -- the messier the better */
len = strlen (tmpl);
if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))