From d829c02f0bab8abea760a3f3e991eb4f5008977c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 18 Dec 2001 02:54:49 +0000 Subject: [PATCH] Add checks for mkstemp and mktemp. Tweak utils.c:mkstemp to honor the HAVE_MKTEMP macro in addition to HAVE_MKSTEMP --- configure.in | 2 ++ libraries/liblutil/utils.c | 5 +++++ 2 files changed, 7 insertions(+) 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 -- 2.39.5