From 3bdbaf54877583e6694c2f3fe6dfa01e351f3b9f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 18 Dec 2001 02:48:20 +0000 Subject: [PATCH] Emulate mkstemp() using mktemp() if mkstemp() is not found by configure --- libraries/liblutil/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5