From: Howard Chu Date: Tue, 18 Dec 2001 02:48:20 +0000 (+0000) Subject: Emulate mkstemp() using mktemp() if mkstemp() is not found by configure X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~623 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3bdbaf54877583e6694c2f3fe6dfa01e351f3b9f;p=openldap Emulate mkstemp() using mktemp() if mkstemp() is not found by configure --- diff --git a/libraries/liblutil/utils.c b/libraries/liblutil/utils.c index 40ba0a971c..8d5fe6b479 100644 --- a/libraries/liblutil/utils.c +++ b/libraries/liblutil/utils.c @@ -8,6 +8,9 @@ #include #include +#ifdef HAVE_FCNTL_H +#include +#endif #include #include @@ -30,6 +33,6 @@ char* lutil_progname( const char* name, int argc, char *argv[] ) #ifndef HAVE_MKSTEMP int mkstemp( char * template ) { - return -1; + return open ( mktemp ( template ), O_RDWR|O_CREAT|O_EXCL, 0600 ); } #endif