Commit 5c931bdf authored by Ben Collins's avatar Ben Collins
Browse files

If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or

liblutil/lockf.c wont be compiled.
parent 3f6dc76a
......@@ -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 */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment