master - configure: Enable realtime by default, if present.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3e333e9b5c0fca...
Commit: 3e333e9b5c0fcae2014dcb22f14d288b440b9576
Parent: 1568ed4d20c2ff67e6cf3e17e158d5153e5f48f8
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Jul 27 14:44:58 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Jul 27 14:44:58 2015 +0100
configure: Enable realtime by default, if present.
---
configure | 6 +++++-
configure.in | 5 +++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 070f3a9..97fe8f2 100755
--- a/configure
+++ b/configure
@@ -1641,7 +1641,7 @@ Optional Features:
--disable-cache_check_needs_check
required if cache_check version is < 0.5
--disable-readline disable readline support
- --enable-realtime enable realtime clock support
+ --disable-realtime disable realtime clock support
--enable-ocf enable Open Cluster Framework (OCF) compliant
resource agents
--enable-cmirrord enable the cluster mirror log daemon
@@ -9206,6 +9206,8 @@ $as_echo_n "checking whether to enable realtime support... " >&6; }
# Check whether --enable-realtime was given.
if test "${enable_realtime+set}" = set; then :
enableval=$enable_realtime; REALTIME=$enableval
+else
+ REALTIME=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $REALTIME" >&5
@@ -12796,6 +12798,8 @@ $as_echo "#define HAVE_REALTIME 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling realtime clock" >&5
$as_echo "$as_me: WARNING: Disabling realtime clock" >&2;}
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_REALTIME" >&5
+$as_echo "$HAVE_REALTIME" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat has st_ctim." >&5
diff --git a/configure.in b/configure.in
index e64baa3..c2cd69a 100644
--- a/configure.in
+++ b/configure.in
@@ -659,8 +659,8 @@ AC_MSG_RESULT($READLINE)
dnl -- Disable realtime clock support
AC_MSG_CHECKING(whether to enable realtime support)
AC_ARG_ENABLE(realtime,
- AC_HELP_STRING([--enable-realtime], [enable realtime clock support]),
- REALTIME=$enableval)
+ AC_HELP_STRING([--disable-realtime], [disable realtime clock support]),
+ REALTIME=$enableval, REALTIME=yes)
AC_MSG_RESULT($REALTIME)
################################################################################
@@ -1573,6 +1573,7 @@ if test "$REALTIME" = yes; then
else
AC_MSG_WARN(Disabling realtime clock)
fi
+ AC_MSG_RESULT($HAVE_REALTIME)
fi
dnl Check if the system has struct stat st_ctim.
8 years, 8 months
master - configure: Add missing checks.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1568ed4d20c2ff...
Commit: 1568ed4d20c2ff67e6cf3e17e158d5153e5f48f8
Parent: 3934ade5a22367f31bb951ebb2a2cb1bfd326f8c
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Jul 27 14:26:56 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Jul 27 14:26:56 2015 +0100
configure: Add missing checks.
---
configure | 756 +++++++++++++++++++++++++++++++++++++++--------
configure.in | 44 ++-
lib/misc/configure.h.in | 52 ++++
3 files changed, 716 insertions(+), 136 deletions(-)
diff --git a/configure b/configure
index 139f332..070f3a9 100755
--- a/configure
+++ b/configure
@@ -620,6 +620,7 @@ ac_includes_default="\
#endif"
ac_header_list=
+ac_func_list=
ac_default_prefix=/usr
ac_subst_vars='LTLIBOBJS
usrsbindir
@@ -2252,116 +2253,116 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
+ eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$5
+$4
int
main ()
{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
+if (sizeof ($2))
+ return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
-else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$5
+$4
int
main ()
{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
+if (sizeof (($2)))
+ return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- eval "$4=yes"
+
else
- eval "$4=no"
+ eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-eval ac_res=\$$4
+eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-} # ac_fn_c_check_member
+} # ac_fn_c_check_type
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
$as_echo_n "(cached) " >&6
else
- eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$4
+$5
int
main ()
{
-if (sizeof ($2))
- return 0;
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$4
+$5
int
main ()
{
-if (sizeof (($2)))
- return 0;
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
-
+ eval "$4=yes"
else
- eval "$3=yes"
+ eval "$4=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-eval ac_res=\$$3
+eval ac_res=\$$4
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-} # ac_fn_c_check_type
+} # ac_fn_c_check_member
# ac_fn_c_find_intX_t LINENO BITS VAR
# -----------------------------------
@@ -2559,6 +2560,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -2843,8 +2890,10 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
-as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " sys/time.h"
as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_func_list " alarm"
+as_fn_append ac_header_list " stdlib.h"
as_fn_append ac_header_list " sys/param.h"
# Check that the precious variables saved in the cache have kept the same
# value.
@@ -5381,6 +5430,99 @@ fi
fi
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <stdbool.h>
+ #ifndef bool
+ "error: bool is not defined"
+ #endif
+ #ifndef false
+ "error: false is not defined"
+ #endif
+ #if false
+ "error: false is not 0"
+ #endif
+ #ifndef true
+ "error: true is not defined"
+ #endif
+ #if true != 1
+ "error: true is not 1"
+ #endif
+ #ifndef __bool_true_false_are_defined
+ "error: __bool_true_false_are_defined is not defined"
+ #endif
+
+ struct s { _Bool s: 1; _Bool t; } s;
+
+ char a[true == 1 ? 1 : -1];
+ char b[false == 0 ? 1 : -1];
+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
+ /* See body of main program for 'e'. */
+ char f[(_Bool) 0.0 == false ? 1 : -1];
+ char g[true];
+ char h[sizeof (_Bool)];
+ char i[sizeof s.t];
+ enum { j = false, k = true, l = false * true, m = true * 256 };
+ /* The following fails for
+ HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+ _Bool n[m];
+ char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+ char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
+
+int
+main ()
+{
+
+ bool e = &s;
+ *pq |= q;
+ *pq |= ! q;
+ /* Refer to every declared value, to avoid compiler optimizations. */
+ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+ + !m + !n + !o + !p + !q + !pq);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdbool_h=yes
+else
+ ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+ ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
@@ -5570,9 +5712,12 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
-for ac_header in locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
- langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
- sys/wait.h time.h
+for ac_header in assert.h ctype.h dirent.h errno.h fcntl.h float.h \
+ getopt.h inttypes.h langinfo.h libgen.h limits.h locale.h paths.h \
+ signal.h stdarg.h stddef.h stdio.h stdlib.h string.h sys/file.h \
+ sys/ioctl.h syslog.h sys/mman.h sys/param.h sys/resource.h sys/stat.h \
+ sys/time.h sys/types.h sys/utsname.h sys/wait.h time.h \
+ unistd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5588,9 +5733,7 @@ fi
done
-case "$host_os" in
- linux*)
- for ac_header in asm/byteorder.h linux/fs.h malloc.h
+for ac_header in termios.h sys/statvfs.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5599,14 +5742,14 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-else
- as_fn_error $? "bailing out" "$LINENO" 5
fi
done
- ;;
- darwin*)
- for ac_header in machine/endian.h sys/disk.h
+
+
+case "$host_os" in
+ linux*)
+ for ac_header in asm/byteorder.h linux/fs.h malloc.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5621,11 +5764,8 @@ fi
done
;;
-esac
-
-for ac_header in ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
- stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
- sys/types.h unistd.h
+ darwin*)
+ for ac_header in machine/endian.h sys/disk.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -5639,20 +5779,8 @@ else
fi
done
-
-for ac_header in termios.h sys/statvfs.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
+ ;;
+esac
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
@@ -5788,6 +5916,51 @@ _ACEOF
fi
+ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_struct_tm=time.h
+else
+ ac_cv_struct_tm=sys/time.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
+$as_echo "$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
+
+fi
+
ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
if test "x$ac_cv_type_off_t" = xyes; then :
@@ -6004,57 +6177,12 @@ _ACEOF
;;
esac
-ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_RDEV 1
-_ACEOF
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <time.h>
-
-int
-main ()
-{
-struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_struct_tm=time.h
-else
- ac_cv_struct_tm=sys/time.h
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
-
-fi
-
################################################################################
-for ac_func in ftruncate gethostname getpagesize \
- gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
- strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
- strstr strtol strtoul uname
+for ac_func in ftruncate gethostname getpagesize gettimeofday localtime_r \
+ memchr memset mkdir mkfifo munmap nl_langinfo realpath rmdir setenv \
+ setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup \
+ strrchr strspn strstr strtol strtoul uname
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -6835,6 +6963,250 @@ done
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
+$as_echo_n "checking for working mktime... " >&6; }
+if ${ac_cv_func_working_mktime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_func_working_mktime=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Test program from Paul Eggert and Tony Leneis. */
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <limits.h>
+#include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifndef HAVE_ALARM
+# define alarm(X) /* empty */
+#endif
+
+/* Work around redefinition to rpl_putenv by other config tests. */
+#undef putenv
+
+static time_t time_t_max;
+static time_t time_t_min;
+
+/* Values we'll use to set the TZ environment variable. */
+static const char *tz_strings[] = {
+ (const char *) 0, "TZ=GMT0", "TZ=JST-9",
+ "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
+};
+#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
+
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
+ Based on a problem report from Andreas Jaeger. */
+static int
+spring_forward_gap ()
+{
+ /* glibc (up to about 1998-10-07) failed this test. */
+ struct tm tm;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ tm.tm_year = 98;
+ tm.tm_mon = 3;
+ tm.tm_mday = 5;
+ tm.tm_hour = 2;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ return mktime (&tm) != (time_t) -1;
+}
+
+static int
+mktime_test1 (time_t now)
+{
+ struct tm *lt;
+ return ! (lt = localtime (&now)) || mktime (lt) == now;
+}
+
+static int
+mktime_test (time_t now)
+{
+ return (mktime_test1 (now)
+ && mktime_test1 ((time_t) (time_t_max - now))
+ && mktime_test1 ((time_t) (time_t_min + now)));
+}
+
+static int
+irix_6_4_bug ()
+{
+ /* Based on code from Ariel Faigon. */
+ struct tm tm;
+ tm.tm_year = 96;
+ tm.tm_mon = 3;
+ tm.tm_mday = 0;
+ tm.tm_hour = 0;
+ tm.tm_min = 0;
+ tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+ mktime (&tm);
+ return tm.tm_mon == 2 && tm.tm_mday == 31;
+}
+
+static int
+bigtime_test (int j)
+{
+ struct tm tm;
+ time_t now;
+ tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+ now = mktime (&tm);
+ if (now != (time_t) -1)
+ {
+ struct tm *lt = localtime (&now);
+ if (! (lt
+ && lt->tm_year == tm.tm_year
+ && lt->tm_mon == tm.tm_mon
+ && lt->tm_mday == tm.tm_mday
+ && lt->tm_hour == tm.tm_hour
+ && lt->tm_min == tm.tm_min
+ && lt->tm_sec == tm.tm_sec
+ && lt->tm_yday == tm.tm_yday
+ && lt->tm_wday == tm.tm_wday
+ && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
+ == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
+ return 0;
+ }
+ return 1;
+}
+
+static int
+year_2050_test ()
+{
+ /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+ ignoring leap seconds. */
+ unsigned long int answer = 2527315200UL;
+
+ struct tm tm;
+ time_t t;
+ tm.tm_year = 2050 - 1900;
+ tm.tm_mon = 2 - 1;
+ tm.tm_mday = 1;
+ tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+ tm.tm_isdst = -1;
+
+ /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+ instead of "TZ=America/Vancouver" in order to detect the bug even
+ on systems that don't support the Olson extension, or don't have the
+ full zoneinfo tables installed. */
+ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0");
+
+ t = mktime (&tm);
+
+ /* Check that the result is either a failure, or close enough
+ to the correct answer that we can assume the discrepancy is
+ due to leap seconds. */
+ return (t == (time_t) -1
+ || (0 < t && answer - 120 <= t && t <= answer + 120));
+}
+
+int
+main ()
+{
+ time_t t, delta;
+ int i, j;
+
+ /* This test makes some buggy mktime implementations loop.
+ Give up after 60 seconds; a mktime slower than that
+ isn't worth using anyway. */
+ alarm (60);
+
+ for (;;)
+ {
+ t = (time_t_max << 1) + 1;
+ if (t <= time_t_max)
+ break;
+ time_t_max = t;
+ }
+ time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max;
+
+ delta = time_t_max / 997; /* a suitable prime number */
+ for (i = 0; i < N_STRINGS; i++)
+ {
+ if (tz_strings[i])
+ putenv ((char*) tz_strings[i]);
+
+ for (t = 0; t <= time_t_max - delta; t += delta)
+ if (! mktime_test (t))
+ return 1;
+ if (! (mktime_test ((time_t) 1)
+ && mktime_test ((time_t) (60 * 60))
+ && mktime_test ((time_t) (60 * 60 * 24))))
+ return 1;
+
+ for (j = 1; ; j <<= 1)
+ if (! bigtime_test (j))
+ return 1;
+ else if (INT_MAX / 2 < j)
+ break;
+ if (! bigtime_test (INT_MAX))
+ return 1;
+ }
+ return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_working_mktime=yes
+else
+ ac_cv_func_working_mktime=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5
+$as_echo "$ac_cv_func_working_mktime" >&6; }
+if test $ac_cv_func_working_mktime = no; then
+ case " $LIBOBJS " in
+ *" mktime.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS mktime.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+
+
+
for ac_func in getpagesize
do :
ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
@@ -12909,6 +13281,147 @@ done
fi
+if test "$BUILD_CMIRRORD" = yes; then
+ for ac_func in atexit
+do :
+ ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit"
+if test "x$ac_cv_func_atexit" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ATEXIT 1
+_ACEOF
+
+else
+ hard_bailout
+fi
+done
+
+fi
+
+if test "$BUILD_LVMLOCKD" = yes; then
+ for ac_func in clock_gettime strtoull
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+ hard_bailout
+fi
+done
+
+fi
+
+if test "$BUILD_LVMPOLLD" = yes; then
+ for ac_func in strpbrk
+do :
+ ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk"
+if test "x$ac_cv_func_strpbrk" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRPBRK 1
+_ACEOF
+
+else
+ hard_bailout
+fi
+done
+
+ ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+ ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+fi
+
if test "$CLVMD" != none; then
for ac_header in mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h
do :
@@ -13625,6 +14138,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
+
################################################################################
ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/raid/Makefile lib/snapshot/Makefile lib/thin/Makefile lib/cache_segtype/Makefile libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdev
mapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan
_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
diff --git a/configure.in b/configure.in
index 7bb18a4..e64baa3 100644
--- a/configure.in
+++ b/configure.in
@@ -91,14 +91,19 @@ AC_PATH_TOOL(CSCOPE_CMD, cscope)
dnl -- Check for header files.
AC_HEADER_DIRENT
AC_HEADER_MAJOR
+AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
-AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
- langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
- sys/wait.h time.h], ,
- [AC_MSG_ERROR(bailing out)])
+AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h \
+ getopt.h inttypes.h langinfo.h libgen.h limits.h locale.h paths.h \
+ signal.h stdarg.h stddef.h stdio.h stdlib.h string.h sys/file.h \
+ sys/ioctl.h syslog.h sys/mman.h sys/param.h sys/resource.h sys/stat.h \
+ sys/time.h sys/types.h sys/utsname.h sys/wait.h time.h \
+ unistd.h], , [AC_MSG_ERROR(bailing out)])
+
+AC_CHECK_HEADERS(termios.h sys/statvfs.h)
case "$host_os" in
linux*)
@@ -107,16 +112,13 @@ case "$host_os" in
AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;;
esac
-AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
- stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
- sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
-AC_CHECK_HEADERS(termios.h sys/statvfs.h)
-
################################################################################
dnl -- Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_CHECK_MEMBERS([struct stat.st_rdev])
+AC_CHECK_TYPES([ptrdiff_t])
+AC_STRUCT_TM
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
@@ -132,15 +134,13 @@ AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
-AC_CHECK_MEMBERS([struct stat.st_rdev])
-AC_STRUCT_TM
################################################################################
dnl -- Check for functions
-AC_CHECK_FUNCS([ftruncate gethostname getpagesize \
- gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
- strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
- strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
+AC_CHECK_FUNCS([ftruncate gethostname getpagesize gettimeofday localtime_r \
+ memchr memset mkdir mkfifo munmap nl_langinfo realpath rmdir setenv \
+ setlocale strcasecmp strchr strcspn strdup strerror strncasecmp strndup \
+ strrchr strspn strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_CHOWN
@@ -148,6 +148,7 @@ AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
+AC_FUNC_MKTIME
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STAT
@@ -1719,6 +1720,19 @@ if test "$READLINE" = yes; then
AC_CHECK_HEADERS(readline/readline.h readline/history.h,,hard_bailout)
fi
+if test "$BUILD_CMIRRORD" = yes; then
+ AC_CHECK_FUNCS(atexit,,hard_bailout)
+fi
+
+if test "$BUILD_LVMLOCKD" = yes; then
+ AC_CHECK_FUNCS(clock_gettime strtoull,,hard_bailout)
+fi
+
+if test "$BUILD_LVMPOLLD" = yes; then
+ AC_CHECK_FUNCS(strpbrk,,hard_bailout)
+ AC_FUNC_STRERROR_R
+fi
+
if test "$CLVMD" != none; then
AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out))
AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,hard_bailout)
diff --git a/lib/misc/configure.h.in b/lib/misc/configure.h.in
index 13e8a2d..750c75c 100644
--- a/lib/misc/configure.h.in
+++ b/lib/misc/configure.h.in
@@ -145,6 +145,9 @@
/* Library version */
#undef DM_LIB_VERSION
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
@@ -161,12 +164,18 @@
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
+/* Define to 1 if you have the `atexit' function. */
+#undef HAVE_ATEXIT
+
/* Define to 1 if canonicalize_file_name is available. */
#undef HAVE_CANONICALIZE_FILE_NAME
/* Define to 1 if your system has a working `chown' function. */
#undef HAVE_CHOWN
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
/* Define to 1 if you have the <corosync/cmap.h> header file. */
#undef HAVE_COROSYNC_CMAP_H
@@ -176,6 +185,10 @@
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -194,6 +207,9 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
@@ -251,6 +267,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
/* Define to 1 if `lstat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_LSTAT_EMPTY_STRING_BUG
@@ -265,6 +284,9 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
+/* Define to 1 if you have the `memchr' function. */
+#undef HAVE_MEMCHR
+
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
@@ -301,9 +323,15 @@
/* Define to 1 if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
+/* Define to 1 if you have the <paths.h> header file. */
+#undef HAVE_PATHS_H
+
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
/* Define to 1 if you have the <readline/history.h> header file. */
#undef HAVE_READLINE_HISTORY_H
@@ -314,6 +342,9 @@
and to 0 otherwise. */
#undef HAVE_REALLOC
+/* Define to 1 if you have the `realpath' function. */
+#undef HAVE_REALPATH
+
/* Define to 1 to include support for realtime clock. */
#undef HAVE_REALTIME
@@ -363,6 +394,9 @@
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
@@ -390,6 +424,9 @@
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
@@ -399,6 +436,12 @@
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
+/* Define to 1 if you have the `strpbrk' function. */
+#undef HAVE_STRPBRK
+
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
@@ -414,6 +457,9 @@
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
+
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
@@ -518,6 +564,9 @@
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
+
/* Internalization package */
#undef INTL_PACKAGE
@@ -632,6 +681,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
/* Path to testsuite data */
#undef TESTSUITE_DATA
8 years, 8 months
master - gitignore: Update for in-place build.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3934ade5a22367...
Commit: 3934ade5a22367f31bb951ebb2a2cb1bfd326f8c
Parent: f4fa3e1a6be13b5d07a6102a642e0cac0d338e62
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Jul 27 13:18:35 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Jul 27 13:18:35 2015 +0100
gitignore: Update for in-place build.
---
.gitignore | 11 +++++++----
conf/.gitignore | 4 ++++
daemons/clvmd/.gitignore | 1 +
daemons/cmirrord/.gitignore | 1 +
daemons/dmeventd/.gitignore | 1 +
daemons/lvmetad/.gitignore | 2 ++
daemons/lvmlockd/.gitignore | 2 ++
daemons/lvmpolld/.gitignore | 1 +
lib/misc/.gitignore | 1 +
python/.gitignore | 2 ++
scripts/.gitignore | 12 ++++++++++++
tools/.gitignore | 1 +
udev/.gitignore | 5 +++++
13 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 52663d4..19181c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,16 @@
*.5
+*.7
*.8
*.a
*.d
*.o
+*.orig
*.pc
*.pot
+*.rej
*.so
*.so.*
-*.swp
+*.sw*
*~
.export.sym
@@ -17,11 +20,11 @@
Makefile
make.tmpl
-configure.h
-version.h
-
/autom4te.cache/
+/autoscan.log
/config.log
/config.status
+/configure.scan
/cscope.out
+/tags
/tmp/
diff --git a/conf/.gitignore b/conf/.gitignore
new file mode 100644
index 0000000..f505a49
--- /dev/null
+++ b/conf/.gitignore
@@ -0,0 +1,4 @@
+command_profile_template.profile
+example.conf
+lvmlocal.conf
+metadata_profile_template.profile
diff --git a/daemons/clvmd/.gitignore b/daemons/clvmd/.gitignore
new file mode 100644
index 0000000..816032f
--- /dev/null
+++ b/daemons/clvmd/.gitignore
@@ -0,0 +1 @@
+clvmd
diff --git a/daemons/cmirrord/.gitignore b/daemons/cmirrord/.gitignore
new file mode 100644
index 0000000..2711e77
--- /dev/null
+++ b/daemons/cmirrord/.gitignore
@@ -0,0 +1 @@
+cmirrord
diff --git a/daemons/dmeventd/.gitignore b/daemons/dmeventd/.gitignore
new file mode 100644
index 0000000..71cca4c
--- /dev/null
+++ b/daemons/dmeventd/.gitignore
@@ -0,0 +1 @@
+dmeventd
diff --git a/daemons/lvmetad/.gitignore b/daemons/lvmetad/.gitignore
new file mode 100644
index 0000000..773097e
--- /dev/null
+++ b/daemons/lvmetad/.gitignore
@@ -0,0 +1,2 @@
+lvmetad
+lvmetactl
diff --git a/daemons/lvmlockd/.gitignore b/daemons/lvmlockd/.gitignore
new file mode 100644
index 0000000..6ba6109
--- /dev/null
+++ b/daemons/lvmlockd/.gitignore
@@ -0,0 +1,2 @@
+lvmlockctl
+lvmlockd
diff --git a/daemons/lvmpolld/.gitignore b/daemons/lvmpolld/.gitignore
new file mode 100644
index 0000000..4ffad0a
--- /dev/null
+++ b/daemons/lvmpolld/.gitignore
@@ -0,0 +1 @@
+lvmpolld
diff --git a/lib/misc/.gitignore b/lib/misc/.gitignore
index 37a05fe..396884b 100644
--- a/lib/misc/.gitignore
+++ b/lib/misc/.gitignore
@@ -1 +1,2 @@
+configure.h
lvm-version.h
diff --git a/python/.gitignore b/python/.gitignore
new file mode 100644
index 0000000..c87e43e
--- /dev/null
+++ b/python/.gitignore
@@ -0,0 +1,2 @@
+.liblvm_built
+setup.py
diff --git a/scripts/.gitignore b/scripts/.gitignore
index 2b9162d..3a668ae 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -1,12 +1,24 @@
+blk_availability_init_red_hat
+blk_availability_systemd_red_hat.service
+blkdeactivate.sh
clvmd_init_red_hat
cmirrord_init_red_hat
dm_event_systemd_red_hat.service
+dm_event_systemd_red_hat.socket
+lvm2_activation_generator_systemd_red_hat
+lvm2_cluster_activation_red_hat.sh
+lvm2_cluster_activation_systemd_red_hat.service
+lvm2_clvmd_systemd_red_hat.service
+lvm2_cmirrord_systemd_red_hat.service
lvm2_lvmetad_init_red_hat
lvm2_lvmetad_systemd_red_hat.service
lvm2_lvmetad_systemd_red_hat.socket
+lvm2_lvmlockd_systemd_red_hat.service
+lvm2_lvmlocking_systemd_red_hat.service
lvm2_lvmpolld_init_red_hat
lvm2_lvmpolld_systemd_red_hat.service
lvm2_lvmpolld_systemd_red_hat.socket
lvm2_monitoring_init_red_hat
lvm2_monitoring_systemd_red_hat.service
+lvm2_pvscan_systemd_red_hat@.service
lvm2_tmpfiles_red_hat.conf
diff --git a/tools/.gitignore b/tools/.gitignore
index d06b2d8..2e7b332 100644
--- a/tools/.gitignore
+++ b/tools/.gitignore
@@ -1,3 +1,4 @@
.commands
dmsetup
+dmstats
lvm
diff --git a/udev/.gitignore b/udev/.gitignore
new file mode 100644
index 0000000..303d787
--- /dev/null
+++ b/udev/.gitignore
@@ -0,0 +1,5 @@
+10-dm.rules
+11-dm-lvm.rules
+13-dm-disk.rules
+69-dm-lvm-metad.rules
+95-dm-notify.rules
8 years, 8 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f4fa3e1a6be13b...
Commit: f4fa3e1a6be13b5d07a6102a642e0cac0d338e62
Parent: ce6a0f4469047b866b4609272da892c849a08393
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jul 24 23:39:54 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jul 24 23:39:54 2015 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index 7aa049b..131a92a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.126(2)-git (2015-07-24)
+2.02.127(2)-git (2015-07-24)
diff --git a/VERSION_DM b/VERSION_DM
index eeff838..f28fdfe 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.103-git (2015-07-24)
+1.02.104-git (2015-07-24)
8 years, 8 months
v2_02_126 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f488bbb3dce8e5...
Commit: f488bbb3dce8e5bccd7f89f7501706a0c5caa22c
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2015-07-24 22:20 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2015-07-24 22:20 +0000
annotated tag: v2_02_126 has been created
at f488bbb3dce8e5bccd7f89f7501706a0c5caa22c (tag)
tagging 33eb7d7dfb772c432251f0926f6a0fb8fb824772 (commit)
replaces v2_02_125
Release 2.02.126.
83 files changed, 1687 insertions(+), 759 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlWyumkACgkQIoGRwVZ+LBeYXwCfcFW6vdZJ68vZpjlePKudbAyJ
XsIAn3rSLnlD1LeC1CDMpjKm1UlSFNHB
=BvSx
-----END PGP SIGNATURE-----
Alasdair G Kergon (8):
post-release
alloc: Fix lvextend failure when varying stripes.
test: Ignore known concurrent VG clvmd failure.
log: Add DM_ABORT_ON_INTERNAL_ERRORS lvm override.
libdm: Use wrappers for all malloc functions.
clvmd: Fix freeze if client dies holding locks.
tools: Streamline long option hyphen removal.
pre-release
Andy Grover (1):
man: add lvmlocal.conf to config cascade
David Teigland (33):
toollib: skip processing the sanlock LV unless named or all
lvmlockctl: fix uninitialized names
lvmlockd: fix unreachable code
lvmlockd: remove log_error instances for normal conditions
vgchange: don't disable VG lock in lock_stop
coverity: cleanup related to lvmlockd
metadata: vg_validate lock_args
metadata: add comments describing lock_args for lvmlockd
pvcreate: remove recent warning message
vgchange: fix disallowed LV types in lockd VG
metadata: fix duplicated LV flag
lockd: disable part of lock_args validation
lvconvert: disallow splitting in lockd VGs
vgchange: allow changing to lockd type when mirrors exist
lockd: note that external origins don't work in lockd VGs
vgexport: do not allow lockd VG to be exported
lockd: allow nolocking and readonly options
lockd: allow vgexport and vgimport
man lvmlockd: update method for changing lock type
lockd: fix error message after a failing to get lock
vgchange: fix lock-start filtering and waiting
metadata: change function name to _allow_extra_system_id
vgexport: fix the all VGs case
vgimport: fix the all VGs case
lockd: fix error cases when built without lvmlockd
lvmlockd: improve errors when lvm is built without a lock manager
vgchange/lvchange: enforce the shared VG lock from lvmlockd
lvconvert: fix polling outside of core lvconvert
lvconvert: merge polling fixes for lockd
pvscan: skip autoactivation for lockd VGs
lvmlockd: improve check for duplicate global locks
Fix dehyphenation cases
lockd: remove an unreachable global lock condition
Marian Csontos (6):
spec: Update to use enable_lockd_*
spec: Move lvm2-lockd into separate package
test: Fix syntax error in prepare_devs
lvmpolld: Fix segfault on 32 bit architectures
test: Fix hardcoded /usr/share in testsuite
test: Help, default and relative paths in runner
Ondrej Kozina (2):
lvconvert: retain retcode consistency
lvconvert: remove unused struct members
Peter Rajnoha (22):
config: add find_config_tree_array
config: replace find_config_tree_node with find_config_tree_array where appropriate
coverity: fix resource leaks
coverity: fix uninitialized values and other reported problems
coverity: missing break in switch expression
coverity: previous commit - not "break" but "fall through"
coverity: fix missing initialization
coverity: fix NULL check in lv->lvid.s
lvmconf: fix ignored --startstopservices in lvmconf ... --mirrorservice on systemd
coverity: fix possible invalid dereferences
coverity: missing return value for dm_split_lvm_name pass proper DM name instead of NULL value
coverity: missing return value checks
libdaemon: config_make_nodes_v needs fixing
config: {thin,cache}_{check,repair}_options are never undefined
config: add "defaulting to" message in case we fall back to defaults in find_config_tree_array
config: use find_config_tree_array for all arrays
config: also log the value used if defined in config, not just defaults
config: make a difference between "not found" and "is empty" in log msg for devices/preferred_names
wiping: ignore errors during detection if use_blkid_wiping=1 and --force is used
wiping: log_warn instead of log_error if blkid wipe ignored for a signature
wiping: add "Wiping skipped." for the message context to be complete
config: add CFG_SECTION_NO_CHECK flag
Zdenek Kabelac (11):
coverity: fix regresions from 16e9b32c2f1
tests: follow symlinks
thin: fix warning for overprovisioning
cache: move setting of cache policy
cache: handle policy_name separately
cache: capture missing policy name
cache: enhance cache-pool validation
makefiles: adding target for generating ctags
cleanup: drop duplicated seg test
cleanup: avoid double assign
cleanup: drop unused header file
8 years, 8 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ce6a0f4469047b...
Commit: ce6a0f4469047b866b4609272da892c849a08393
Parent: 33eb7d7dfb772c432251f0926f6a0fb8fb824772
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jul 24 23:21:51 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jul 24 23:21:51 2015 +0100
post-release
---
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index eacc2c9..df2a730 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.127 -
+=================================
+
Version 2.02.126 - 24th July 2015
=================================
Fix long option hyphen removal. (2.02.122)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9486514..dcc2a24 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.104 -
+=================================
+
Version 1.02.103 - 24th July 2015
=================================
Introduce libdevmapper wrappers for all malloc-related functions.
8 years, 8 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=33eb7d7dfb772c...
Commit: 33eb7d7dfb772c432251f0926f6a0fb8fb824772
Parent: 705caa8c32782a9b42cdd05138cf61536e0a99f9
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jul 24 23:20:42 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jul 24 23:20:42 2015 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index c491170..7aa049b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.126(2)-git (2015-07-07)
+2.02.126(2)-git (2015-07-24)
diff --git a/VERSION_DM b/VERSION_DM
index 9c79a79..eeff838 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.103-git (2015-07-07)
+1.02.103-git (2015-07-24)
diff --git a/WHATS_NEW b/WHATS_NEW
index 8f74625..eacc2c9 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.126 -
-================================
+Version 2.02.126 - 24th July 2015
+=================================
Fix long option hyphen removal. (2.02.122)
Fix clvmd freeze if client disappears without first releasing its locks.
Fix lvconvert segfaults while performing snapshots merge.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3dba5b8..9486514 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.103 -
-================================
+Version 1.02.103 - 24th July 2015
+=================================
Introduce libdevmapper wrappers for all malloc-related functions.
Version 1.02.102 - 7th July 2015
8 years, 8 months
master - tools: Streamline long option hyphen removal.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=705caa8c32782a...
Commit: 705caa8c32782a9b42cdd05138cf61536e0a99f9
Parent: c1f5ac3eca1ebccc08fdc3f9304e3d85fa115146
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jul 24 19:45:49 2015 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jul 24 19:45:49 2015 +0100
tools: Streamline long option hyphen removal.
---
WHATS_NEW | 1 +
tools/lvmcmdline.c | 48 ++++++++++++++++++++++++++----------------------
2 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 03e76c7..8f74625 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.126 -
================================
+ Fix long option hyphen removal. (2.02.122)
Fix clvmd freeze if client disappears without first releasing its locks.
Fix lvconvert segfaults while performing snapshots merge.
Ignore errors during detection if use_blkid_wiping=1 and --force is used.
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 403948a..9e0d029 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1463,8 +1463,6 @@ static int _init_lvmlockd(struct cmd_context *cmd)
return 1;
}
-#define MAX_ARG_LEN 64
-
int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
{
struct dm_config_tree *config_string_cft;
@@ -1472,10 +1470,9 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
int ret = 0;
int locking_type;
int monitoring;
- char arg_new[MAX_ARG_LEN];
- char *arg;
- int quit_arg_hyphen_removal;
- int i, j, j_new;
+ char *arg_new, *arg;
+ int i;
+ int skip_hyphens;
init_error_message_produced(0);
@@ -1484,28 +1481,35 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
/* eliminate '-' from all options starting with -- */
for (i = 1; i < argc; i++) {
- quit_arg_hyphen_removal = 0;
+
arg = argv[i];
- if (arg[0] == '-' && arg[1] == '-' && strlen(arg) == 2)
+ if (*arg++ != '-' || *arg++ != '-')
+ continue;
+
+ /* If we reach "--" then stop. */
+ if (!*arg)
break;
- if (arg[0] == '-' && arg[1] == '-' && strlen(arg) < MAX_ARG_LEN) {
- memset(arg_new, 0, sizeof(arg_new));
- arg_new[0] = '-';
- arg_new[1] = '-';
-
- for (j = 2, j_new = 2; j < strlen(arg) + 1; j++) {
- if (arg[j] == '=')
- quit_arg_hyphen_removal = 1;
- if (!quit_arg_hyphen_removal && arg[j] == '-')
- continue;
- arg_new[j_new] = arg[j];
- j_new++;
+ arg_new = arg;
+ skip_hyphens = 1;
+ while (*arg) {
+ /* If we encounter '=', stop any further hyphen removal. */
+ if (*arg == '=')
+ skip_hyphens = 0;
+
+ /* Do we need to keep the next character? */
+ if (*arg != '-' || !skip_hyphens) {
+ if (arg_new != arg)
+ *arg_new = *arg;
+ ++arg_new;
}
-
- memcpy(argv[i], arg_new, strlen(arg_new) + 1);
+ arg++;
}
+
+ /* Terminate a shortened arg */
+ if (arg_new != arg)
+ *arg_new = '\0';
}
if (!(cmd->cmd_line = _copy_command_line(cmd, argc, argv)))
8 years, 8 months
master - lockd: remove an unreachable global lock condition
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1f5ac3eca1ebc...
Commit: c1f5ac3eca1ebccc08fdc3f9304e3d85fa115146
Parent: bcb875dcb19323ab62f2f3b409c4bda4ce8267d1
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jul 23 11:00:03 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 24 10:56:08 2015 -0500
lockd: remove an unreachable global lock condition
There is no longer an "enable" option for the global lock,
so remove the bit of code that was checking for it. It
was an optional variation anyway, and not one that was likely
to be used.
Also update the corresponding comment describing global lock
creation.
---
lib/locking/lvmlockd.c | 63 ++++++++++++-----------------------------------
1 files changed, 16 insertions(+), 47 deletions(-)
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index ac8c155..e9d7882 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -1169,55 +1169,24 @@ int lockd_gl_create(struct cmd_context *cmd, const char *def_mode, const char *v
return 1;
/*
- * This is the explicit sanlock bootstrap condition for
- * proceding without the global lock: a chicken/egg case
- * for the first sanlock VG that is created.
+ * This is the sanlock bootstrap condition for proceding
+ * without the global lock: a chicken/egg case for the first
+ * sanlock VG that is created. When creating the first
+ * sanlock VG, there is no global lock to acquire because
+ * the gl will exist in the VG being created. So, we
+ * skip acquiring the global lock when creating this initial
+ * VG, and enable the global lock in this VG.
*
- * When creating the first sanlock VG, there is no global
- * lock to acquire because the gl will exist in the VG
- * being created. The "enable" option makes explicit that
- * this is expected:
+ * Here we assume that this is an initial bootstrap condition
+ * based on the fact that lvmlockd has seen no lockd VGs.
+ * (A commmand line option could be added to allow the user
+ * to make this initial bootstrap condition explicit.)
*
- * vgcreate --lock-type sanlock --lock-gl enable
- *
- * There are three indications that this is the unique
- * first-sanlock-vg bootstrap case:
- *
- * - result from lvmlockd is -ENOLS because lvmlockd found
- * no lockspace for this VG; expected because it's being
- * created here.
- *
- * - result flag LD_RF_NO_GL_LS from lvmlockd means that
- * lvmlockd has seen no other lockspace with a global lock.
- * This implies that this is probably the first sanlock vg
- * to be created. If other sanlock vgs exist, the global
- * lock should be available from one of them.
- *
- * - command line lock-gl arg is "enable" which means the
- * user expects this to be the first sanlock vg, and the
- * global lock should be enabled in it.
- */
-
- if ((lockd_flags & LD_RF_NO_GL_LS) &&
- !strcmp(vg_lock_type, "sanlock") &&
- !strcmp(mode, "enable")) {
- log_print_unless_silent("Enabling sanlock global lock");
- lvmetad_validate_global_cache(cmd, 1);
- return 1;
- }
-
- /*
- * This is an implicit sanlock bootstrap condition for
- * proceeding without the global lock. The command line does
- * not indicate explicitly that this is a bootstrap situation
- * (via "enable"), but it seems likely to be because lvmlockd
- * has seen no lockd-type vgs. It is possible that a global
- * lock does exist in a vg that has not yet been seen. If that
- * vg appears after this creates a new vg with a new enabled
- * gl, then there will be two enabled global locks, and one
- * will need to be disabled. (We could instead return an error
- * here and insist with an error message that the --lock-gl
- * enable option be used to exercise the explicit case above.)
+ * That assumption might be wrong. It is possible that a global
+ * lock does exist in a VG that has not yet been seen. If that
+ * VG appears after this creates a new VG with a new enabled
+ * global lock, then there will be two VGs containing enabled
+ * global locks, and one will need to be disabled by the user.
*/
if ((lockd_flags & LD_RF_NO_GL_LS) &&
8 years, 8 months
master - Fix dehyphenation cases
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bcb875dcb19323...
Commit: bcb875dcb19323ab62f2f3b409c4bda4ce8267d1
Parent: be662439331abf6ccb16dd996bfe15eb613b4e53
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jul 24 10:25:13 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jul 24 10:25:13 2015 -0500
Fix dehyphenation cases
Stop removing hyphens when = is seen. With an option
like --profile=thin-performance, the hyphen removal
will stop at = and will not remove - after thin.
Stop removing hyphens altogether when a stand alone arg
of -- appears.
---
tools/lvmcmdline.c | 41 +++++++++++++++++++++++++----------------
1 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 6dbc189..403948a 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1463,6 +1463,8 @@ static int _init_lvmlockd(struct cmd_context *cmd)
return 1;
}
+#define MAX_ARG_LEN 64
+
int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
{
struct dm_config_tree *config_string_cft;
@@ -1470,8 +1472,10 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
int ret = 0;
int locking_type;
int monitoring;
- char *arg_new, *arg;
- int i;
+ char arg_new[MAX_ARG_LEN];
+ char *arg;
+ int quit_arg_hyphen_removal;
+ int i, j, j_new;
init_error_message_produced(0);
@@ -1479,24 +1483,29 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
sigint_clear();
/* eliminate '-' from all options starting with -- */
- for (i = 1; i < argc; ++i) {
-
- if (argv[i][0] != '-' || argv[i][1] != '-')
- continue;
+ for (i = 1; i < argc; i++) {
+ quit_arg_hyphen_removal = 0;
+ arg = argv[i];
- arg_new = arg = argv[i] + 2;
+ if (arg[0] == '-' && arg[1] == '-' && strlen(arg) == 2)
+ break;
- while (*arg) {
- if (*arg != '-') {
- if (arg_new != arg)
- *arg_new = *arg;
- ++arg_new;
+ if (arg[0] == '-' && arg[1] == '-' && strlen(arg) < MAX_ARG_LEN) {
+ memset(arg_new, 0, sizeof(arg_new));
+ arg_new[0] = '-';
+ arg_new[1] = '-';
+
+ for (j = 2, j_new = 2; j < strlen(arg) + 1; j++) {
+ if (arg[j] == '=')
+ quit_arg_hyphen_removal = 1;
+ if (!quit_arg_hyphen_removal && arg[j] == '-')
+ continue;
+ arg_new[j_new] = arg[j];
+ j_new++;
}
- ++arg;
- }
- if (arg_new != arg)
- *arg_new = 0;
+ memcpy(argv[i], arg_new, strlen(arg_new) + 1);
+ }
}
if (!(cmd->cmd_line = _copy_command_line(cmd, argc, argv)))
8 years, 8 months