mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 07:09:34 -05:00
Add checks for mkstemp and mktemp. Tweak utils.c:mkstemp to honor the
HAVE_MKTEMP macro in addition to HAVE_MKSTEMP
This commit is contained in:
parent
3bdbaf5487
commit
d829c02f0b
2 changed files with 7 additions and 0 deletions
|
|
@ -2337,6 +2337,8 @@ AC_CHECK_FUNCS( \
|
||||||
lockf \
|
lockf \
|
||||||
memcpy \
|
memcpy \
|
||||||
memmove \
|
memmove \
|
||||||
|
mkstemp \
|
||||||
|
mktemp \
|
||||||
pipe \
|
pipe \
|
||||||
read \
|
read \
|
||||||
recv \
|
recv \
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <ac/stdlib.h>
|
#include <ac/stdlib.h>
|
||||||
#include <ac/string.h>
|
#include <ac/string.h>
|
||||||
|
#include <ac/unistd.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -33,6 +34,10 @@ char* lutil_progname( const char* name, int argc, char *argv[] )
|
||||||
#ifndef HAVE_MKSTEMP
|
#ifndef HAVE_MKSTEMP
|
||||||
int mkstemp( char * template )
|
int mkstemp( char * template )
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MKTEMP
|
||||||
return open ( mktemp ( template ), O_RDWR|O_CREAT|O_EXCL, 0600 );
|
return open ( mktemp ( template ), O_RDWR|O_CREAT|O_EXCL, 0600 );
|
||||||
|
#else
|
||||||
|
return -1
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue