mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or
liblutil/lockf.c wont be compiled.
This commit is contained in:
parent
3f6dc76a59
commit
5c931bdffa
2 changed files with 4 additions and 3 deletions
|
|
@ -85,6 +85,7 @@ extern char* getpass LDAP_P((const char *getpass));
|
|||
|
||||
#if !defined( ldap_lockf )
|
||||
/* use some simplistic locking method */
|
||||
# define NEED_SIMPLE_LOCKING
|
||||
# include <lutil_lockf.h>
|
||||
# define ldap_lockf(x) lutil_lockf(x)
|
||||
# define ldap_unlockf(x) lutil_unlockf(x)
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
* license is available at http://www.OpenLDAP.org/license.html or
|
||||
* in file LICENSE in the top-level directory of the distribution.
|
||||
*/
|
||||
/* File locking methods */
|
||||
/* Simple file locking method for systems without */
|
||||
|
||||
#include "portable.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ac/unistd.h>
|
||||
|
||||
#if defined(NEED_FCNTL_LOCKING)
|
||||
#ifdef NEED_SIMPLE_LOCKING
|
||||
|
||||
int lutil_lockf ( FILE *fp ) {
|
||||
struct flock file_lock;
|
||||
|
|
@ -36,4 +36,4 @@ int lutil_unlockf ( FILE *fp ) {
|
|||
return ( fcntl( fileno(fp), F_SETLK, &file_lock ) );
|
||||
}
|
||||
|
||||
#endif /* !HAVE_FILE_LOCKING */
|
||||
#endif /* NEED_SIMPLE_LOCKING */
|
||||
|
|
|
|||
Loading…
Reference in a new issue