configure.in: Add check for KRB5_POSIX_LOCKS
authorTheodore Tso <tytso@mit.edu>
Fri, 28 Apr 1995 20:36:57 +0000 (20:36 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 28 Apr 1995 20:36:57 +0000 (20:36 +0000)
krb_dbm.c: Add #include of fcntl.h; if POSIX_FILE_LOCKS is
        defined, use POSIX-style locking.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5634 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb4/ChangeLog
src/lib/kdb4/configure.in
src/lib/kdb4/krb_dbm.c

index a9cd5349601f307a3f8fe0ba791198150c49af8e..f27dddc8077a233dc7ee9e782212b48bd8150621 100644 (file)
@@ -1,3 +1,10 @@
+Fri Apr 28 16:24:20 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * configure.in: Add check for KRB5_POSIX_LOCKS
+
+       * krb_dbm.c: Add #include of fcntl.h; if POSIX_FILE_LOCKS is
+               defined, use POSIX-style locking.
+
 Fri Jan 13 18:24:26 1995  Ian Lance Taylor  <ian@sanguine.cygnus.com>
 
        * krb_kdb_utils.c (kdb_verify_master_key): Don't say ``BEWARE!'',
index 0f69f3b44d0eb46fc0ca8207606ffbdfe7865860..c9f3fe7e316e39b65454320e45087bcc39fc2d40 100644 (file)
@@ -11,6 +11,7 @@ AC_PROG_INSTALL
 AC_HEADER_CHECK(ndbm.h,AC_DEFINE(NDBM))
 AC_CONST
 CHECK_FCNTL
+KRB5_POSIX_LOCKS
 AC_HEADER_CHECK(unistd.h,AC_DEFINE(HAS_UNISTD_H))
 ET_RULES
 SubdirLibraryRule([$(OBJS)])
index c67c020bab138b9235cec3294282d1a533410a24..bf3ede81ffd7c0da612edcb797c2002c492e151f 100644 (file)
@@ -17,6 +17,7 @@
 #include <string.h>
 #include <des.h>
 #include <sys/file.h>
+#include <fcntl.h>
 /* before krb_db.h */
 #include <krb.h>
 #include <krb_db.h>
@@ -27,7 +28,7 @@
 #include <dbm.h>
 #endif /*NDBM*/
 
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
 #include <fcntl.h>
 #endif
 
@@ -730,7 +731,7 @@ static void kerb_dbl_fini()
 static int kerb_dbl_lock(mode)
     int     mode;
 {
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
     struct flock f;
     int rv;
 #else
@@ -745,13 +746,13 @@ static int kerb_dbl_lock(mode)
        fflush(stderr);
        exit(1);
     }
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
     memset(&f, 0, sizeof(f));
 #endif
 
     switch (mode) {
     case KERB_DBL_EXCLUSIVE:
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
        f.l_type = F_WRLCK;
 #else
        flock_mode = LOCK_EX;
@@ -759,7 +760,7 @@ static int kerb_dbl_lock(mode)
        break;
 
     case KERB_DBL_SHARED:
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
        f.l_type = F_RDLCK;
 #else
        flock_mode = LOCK_SH;
@@ -771,7 +772,7 @@ static int kerb_dbl_lock(mode)
        abort();
     }
 
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
     if (non_blocking)
        rv = fcntl (dblfd, F_SETLK, &f);
     else
@@ -791,7 +792,7 @@ static int kerb_dbl_lock(mode)
 
 static void kerb_dbl_unlock()
 {
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
     struct flock f;
 #endif
     
@@ -800,7 +801,7 @@ static void kerb_dbl_unlock()
        fflush(stderr);
        exit(1);
     }
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
     memset(&f, 0, sizeof (f));
     f.l_type = F_UNLCK;
     if (fcntl(dblfd, F_SETLK, &f) < 0) {