From: Ben Collins Date: Sun, 28 Mar 1999 18:07:44 +0000 (+0000) Subject: If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~320 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c931bdffa0d3201c90b2c22cb56e75d8b8c6494;p=openldap If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or liblutil/lockf.c wont be compiled. --- diff --git a/include/ac/unistd.h b/include/ac/unistd.h index 0162d49ca4..e5b3eb3300 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -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 # define ldap_lockf(x) lutil_lockf(x) # define ldap_unlockf(x) lutil_unlockf(x) diff --git a/libraries/liblutil/lockf.c b/libraries/liblutil/lockf.c index 7307720dd6..13226bbf59 100644 --- a/libraries/liblutil/lockf.c +++ b/libraries/liblutil/lockf.c @@ -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 #include -#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 */