diff options
-rw-r--r-- | include/arch/unix/locks.h | 3 | ||||
-rw-r--r-- | locks/unix/locks.c | 4 | ||||
-rw-r--r-- | locks/unix/locks.h | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/include/arch/unix/locks.h b/include/arch/unix/locks.h index f6d37100d..847a8107b 100644 --- a/include/arch/unix/locks.h +++ b/include/arch/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 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 |