]> diplodocus.org Git - nmh/blobdiff - sbr/lock_file.c
Beginning of work to run mhbuild always. A bit more complicated than I
[nmh] / sbr / lock_file.c
index 80b93a9035e008a38475dec9b3bb12ee7bf5bf62..01d7ae49a849e4710c46ca7942334dfc05d2de54 100644 (file)
 #ifdef HAVE_FLOCK
 # include <sys/file.h>
 #endif
-#ifdef HAVE_LOCKF
-# include <unistd.h>
-#endif
 
 #if defined(HAVE_LIBLOCKFILE)
-#include <lockfile.h>
+# include <lockfile.h>
 #endif
 
 #ifdef LOCKDIR
@@ -383,6 +380,7 @@ lkopen_fcntl(const char *file, int access, mode_t mode)
 }
 
 
+#ifdef HAVE_FLOCK
 /*
  * Open and lock a file, using flock locking
  */
@@ -415,7 +413,7 @@ lkopen_flock(const char *file, int access, mode_t mode)
     errno = saved_errno;
     return -1;
 }
-
+#endif /* HAVE_FLOCK */
 
 /*
  * Open and lock a file, using lockf locking