closures: Check for mkostemp(3)

This commit is contained in:
Mickaël Salaün
2014-05-12 19:44:08 +02:00
parent 8daeed9570
commit c1166d4f65
2 changed files with 8 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ EOF
AM_MAINTAINER_MODE
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_FUNCS(mmap)
AC_CHECK_FUNCS([mmap mkostemp])
AC_FUNC_MMAP_BLACKLIST
dnl The -no-testsuite modules omit the test subdir.

View File

@@ -267,7 +267,13 @@ static size_t execsize = 0;
static int
open_temp_exec_file_name (char *name, int flags)
{
int fd = mkostemp (name, flags);
int fd;
#ifdef HAVE_MKOSTEMP
fd = mkostemp (name, flags);
#else
fd = mkstemp (name);
#endif
if (fd != -1)
unlink (name);