Fix a build fail on mingw

Regarding the change of 596931c8b4
This commit is contained in:
Akira TAGOH 2013-01-08 16:20:28 +09:00
parent d837a7a584
commit 4e6c7d0827
2 changed files with 5 additions and 1 deletions

View File

@ -141,7 +141,7 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp mkostemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp mkostemp _mktemp_s strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.

View File

@ -95,6 +95,10 @@ FcMakeTempfile (char *template)
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
# endif
#elif HAVE__MKTEMP_S
if (_mktemp_s(template, strlen(template) + 1) != 0)
return -1;
fd = FcOpen(template, O_RDWR | O_EXCL | O_CREAT, 0600);
#else
#error no secure functions to create a temporary file
#endif