diff --git a/configure.in b/configure.in index 2784cb931b..ce73845001 100644 --- a/configure.in +++ b/configure.in @@ -2337,6 +2337,8 @@ AC_CHECK_FUNCS( \ lockf \ memcpy \ memmove \ + mkstemp \ + mktemp \ pipe \ read \ recv \ diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index 8d5fe6b479..a3008a38d5 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -8,6 +8,7 @@ #include #include +#include #ifdef HAVE_FCNTL_H #include #endif @@ -33,6 +34,10 @@ char* lutil_progname( const char* name, int argc, char *argv[] ) #ifndef HAVE_MKSTEMP int mkstemp( char * template ) { +#ifdef HAVE_MKTEMP return open ( mktemp ( template ), O_RDWR|O_CREAT|O_EXCL, 0600 ); +#else + return -1 +#endif } #endif