summaryrefslogtreecommitdiff
path: root/locks
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2000-06-03 00:31:14 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2000-06-03 00:31:14 +0000
commita4b89d0aff67a491c9ff8b5499b039e15a88c163 (patch)
tree001a2ea0a9eb332ba1f6b3e036d324fba34500b4 /locks
parent754431afb15e585de7e0ce23b6c79c7ce7d1f3f3 (diff)
downloadlibapr-a4b89d0aff67a491c9ff8b5499b039e15a88c163.tar.gz
FreeBSD 4.0 doesn't like tempnam, so we are using mkstemp now. I hope
this works on all platforms, but if not we'll just use a #ifdef later. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r--locks/unix/locks.c4
-rw-r--r--locks/unix/locks.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/locks/unix/locks.c b/locks/unix/locks.c
index 5b40cc242..48de7a75d 100644
--- a/locks/unix/locks.c
+++ b/locks/unix/locks.c
@@ -74,7 +74,9 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type,
new->fname = ap_pstrdup(cont, fname);
}
else {
- new->fname = ap_pstrdup(cont, tempnam(NULL, NULL));
+ char *filename = "/tmp/aprXXXXXX";
+ new->interproc = mkstemp(filename);
+ new->fname = ap_pstrdup(cont, filename);
unlink(new->fname);
}
}
diff --git a/locks/unix/locks.h b/locks/unix/locks.h
index f6d37100d..847a8107b 100644
--- a/locks/unix/locks.h
+++ b/locks/unix/locks.h
@@ -85,6 +85,9 @@
#if HAVE_STDIO_H
#include <stdio.h>
#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif