mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Emulate mkstemp() using mktemp() if mkstemp() is not found by configure
This commit is contained in:
parent
ca975216b8
commit
3bdbaf5487
1 changed files with 4 additions and 1 deletions
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <ac/stdlib.h>
|
||||
#include <ac/string.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <lber.h>
|
||||
#include <lutil.h>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue