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
+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!'',
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)])
#include <string.h>
#include <des.h>
#include <sys/file.h>
+#include <fcntl.h>
/* before krb_db.h */
#include <krb.h>
#include <krb_db.h>
#include <dbm.h>
#endif /*NDBM*/
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
#include <fcntl.h>
#endif
static int kerb_dbl_lock(mode)
int mode;
{
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
struct flock f;
int rv;
#else
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;
break;
case KERB_DBL_SHARED:
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
f.l_type = F_RDLCK;
#else
flock_mode = LOCK_SH;
abort();
}
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
if (non_blocking)
rv = fcntl (dblfd, F_SETLK, &f);
else
static void kerb_dbl_unlock()
{
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
struct flock f;
#endif
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) {