From 730151273020b6fd7262e34ad323c017a30951c8 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 7 Oct 1994 18:21:02 +0000 Subject: [PATCH] Include unistd.h if it is present Use POSIX_FILE_LOCKS if _POSIX_VERSION is defined. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4482 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/file/ChangeLog | 5 +++++ src/lib/krb5/ccache/file/configure.in | 1 + src/lib/krb5/ccache/file/fcc_maybe.c | 11 ++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog index eeacb9dd8..219f21b47 100644 --- a/src/lib/krb5/ccache/file/ChangeLog +++ b/src/lib/krb5/ccache/file/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 7 14:18:44 1994 Theodore Y. Ts'o (tytso@dcl) + + * configure.in: Add test for unistd.h + * fcc_maybe.c: Use POSIX_FILE_LOCKS if _POSIX_VERSION is defined. + Fri Sep 30 21:54:20 1994 Theodore Y. Ts'o (tytso@dcl) * fcc_defops.c (krb5_cc_file_ops): diff --git a/src/lib/krb5/ccache/file/configure.in b/src/lib/krb5/ccache/file/configure.in index 52832f2ac..c272628cc 100644 --- a/src/lib/krb5/ccache/file/configure.in +++ b/src/lib/krb5/ccache/file/configure.in @@ -2,6 +2,7 @@ AC_INIT(configure.in) WITH_CCOPTS AC_SET_BUILDTOP CONFIG_RULES +AC_HAVE_HEADERS(unistd.h) SubdirLibraryRule([${OBJS}]) KRB_INCLUDE AC_OUTPUT(Makefile,[EXTRA_RULES]) diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c index 0de6b206a..f60f20fc8 100644 --- a/src/lib/krb5/ccache/file/fcc_maybe.c +++ b/src/lib/krb5/ccache/file/fcc_maybe.c @@ -24,7 +24,10 @@ * This file contains the source code for conditional open/close calls. */ - +#if HAVE_UNISTD_H +#include +#endif + #include "fcc.h" #include #include @@ -41,6 +44,12 @@ int krb5_fcc_default_format = KRB5_FCC_DEFAULT_FVNO; #include #include +#ifdef _POSIX_VERSION + /* Is there a better way to decide whether or not we should use flock */ + /* vs. fcntl. Example: broken SunOS tmpfs.... */ +#define POSIX_FILE_LOCKS +#endif + #ifdef POSIX_FILE_LOCKS #ifndef unicos61 #include -- 2.26.2