Include unistd.h if it is present
authorTheodore Tso <tytso@mit.edu>
Fri, 7 Oct 1994 18:21:02 +0000 (18:21 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 7 Oct 1994 18:21:02 +0000 (18:21 +0000)
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
src/lib/krb5/ccache/file/configure.in
src/lib/krb5/ccache/file/fcc_maybe.c

index eeacb9dd8394934c3ff4caf8eeb7ee72f222564e..219f21b473b821dfe08085df656619c4fbf1ca30 100644 (file)
@@ -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):
index 52832f2ac724c6b5340f34b8d849c57a0c3ac03d..c272628cc629c10a1df2be062268e22332d94f06 100644 (file)
@@ -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])
index 0de6b206a2a892ed507ac0486739f463ceb985c3..f60f20fc8898041124dfa6cb69ab15d3bf5ed994 100644 (file)
  * This file contains the source code for conditional open/close calls.
  */
 
-
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+          
 #include "fcc.h"
 #include <errno.h>
 #include <krb5/osconf.h>
@@ -41,6 +44,12 @@ int krb5_fcc_default_format = KRB5_FCC_DEFAULT_FVNO;
 #include <krb5/los-proto.h>
 #include <stdio.h>
 
+#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 <fcntl.h>