]> git.sur5r.net Git - openldap/commitdiff
Add checks for mkstemp and mktemp. Tweak utils.c:mkstemp to honor the
authorHoward Chu <hyc@openldap.org>
Tue, 18 Dec 2001 02:54:49 +0000 (02:54 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 18 Dec 2001 02:54:49 +0000 (02:54 +0000)
HAVE_MKTEMP macro in addition to HAVE_MKSTEMP

configure.in
libraries/liblutil/utils.c

index 2784cb931b035427062c42fd2e9ff912fa5cb09d..ce738450016b9ab8247ec51ece24297681cae730 100644 (file)
@@ -2337,6 +2337,8 @@ AC_CHECK_FUNCS(           \
        lockf                   \
        memcpy                  \
        memmove                 \
+       mkstemp                 \
+       mktemp                  \
        pipe                    \
        read                    \
        recv                    \
index 8d5fe6b479c2976552bfb765e368117e6cd8dd13..a3008a38d5aa106afc54202e669df8f40f88b863 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <ac/stdlib.h>
 #include <ac/string.h>
+#include <ac/unistd.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #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