]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
make file locking compiletime configurable
authorTobias Oetiker <tobi@oetiker.ch>
Wed, 14 May 2014 14:23:32 +0000 (16:23 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 14 May 2014 14:23:32 +0000 (16:23 +0200)
configure.ac
src/rrd_open.c

index 5fbcfb19902f809b4919fd2149bd7c118cb95cf9..ce2e66048f330607682dcb57ebb2e55bc4f3460e 100644 (file)
@@ -13,7 +13,7 @@ AC_PREREQ(2.59)
 
 dnl the official version number is
 dnl a.b.c
-AC_INIT([rrdtool],[1.4.999])
+AC_INIT([rrdtool],m4_esyscmd([tr -d '\n' < VERSION]))
 
 dnl for testing a numberical version number comes handy
 dnl the released version are
@@ -131,6 +131,14 @@ AS_HELP_STRING([--disable-mmap],[disable mmap in rrd_update, use seek+write inst
 AC_ARG_ENABLE(pthread,AS_HELP_STRING([--disable-pthread],[disable multithread support]),
 [],[enable_pthread=yes])
 
+AC_ARG_ENABLE([flock],
+AS_HELP_STRING([--disable-flock],[disable file locking]),
+[],
+[enable_flock=yes])
+if test x$enable_file != xyes; then
+    AC_DEFINE([DISABLE_FLOCK], [], [disable flock calls in rrdtool])
+fi
+
 AC_ARG_ENABLE(static-programs,
      AS_HELP_STRING([--enable-static-programs],[Build static programs]),
      [case "${enableval}" in
@@ -964,6 +972,7 @@ echo "----------------------------------------------------------------"
 echo "Config is DONE!"
 echo
 echo "          With MMAP IO: $enable_mmap"
+echo "          With Locking: $enable_flock"
 echo "      Build rrd_getopt: $build_getopt"
 echo "       Build rrd_graph: $enable_rrd_graph"
 echo "       Static programs: $staticprogs"
index 8d055a3219ecc1dea36c69f1c8f8611d7ab28b26..4f011a262a30e39bea741cf266a0911b9325ec87 100644 (file)
@@ -500,7 +500,9 @@ int rrd_lock(
     int       rcstat;
     rrd_simple_file_t *rrd_simple_file;
     rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt;
-
+#ifdef DISABLE_FLOCK
+    return 0;
+#else
     {
 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
         struct _stat st;
@@ -523,6 +525,7 @@ int rrd_lock(
     }
 
     return (rcstat);
+#endif
 }