From: Ruben Kerkhof Date: Sat, 17 Nov 2012 17:19:58 +0000 (+0100) Subject: Fix java detection as unprivileged user. X-Git-Tag: collectd-5.2.0^0 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e51b86dec5842bcb31d2f73e6043e21de4c51100;p=collectd.git Fix java detection as unprivileged user. If you have an inaccessible directory inside JAVA_HOME, find returns an error and the test fails. I found this on Fedora, where /usr/lib64/audit is only readable by root, and my JAVA_HOME was set to /usr Signed-off-by: Florian Forster --- diff --git a/configure.in b/configure.in index cd24f536..98395ed1 100644 --- a/configure.in +++ b/configure.in @@ -1980,7 +1980,7 @@ then if test -d "$with_java_home" then AC_MSG_CHECKING([for jni.h]) - TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' | head -n 1` + TMPDIR=`find "$with_java_home" -name jni.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` if test "x$TMPDIR" != "x" then AC_MSG_RESULT([found in $TMPDIR]) @@ -1990,7 +1990,7 @@ then fi AC_MSG_CHECKING([for jni_md.h]) - TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' | head -n 1` + TMPDIR=`find "$with_java_home" -name jni_md.h -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` if test "x$TMPDIR" != "x" then AC_MSG_RESULT([found in $TMPDIR]) @@ -2000,7 +2000,7 @@ then fi AC_MSG_CHECKING([for libjvm.so]) - TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' | head -n 1` + TMPDIR=`find "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1` if test "x$TMPDIR" != "x" then AC_MSG_RESULT([found in $TMPDIR]) @@ -2012,7 +2012,7 @@ then if test "x$JAVAC" = "x" then AC_MSG_CHECKING([for javac]) - TMPDIR=`find "$with_java_home" -name javac -type f | head -n 1` + TMPDIR=`find "$with_java_home" -name javac -type f 2>/dev/null | head -n 1` if test "x$TMPDIR" != "x" then JAVAC="$TMPDIR" @@ -2024,7 +2024,7 @@ then if test "x$JAR" = "x" then AC_MSG_CHECKING([for jar]) - TMPDIR=`find "$with_java_home" -name jar -type f | head -n 1` + TMPDIR=`find "$with_java_home" -name jar -type f 2>/dev/null | head -n 1` if test "x$TMPDIR" != "x" then JAR="$TMPDIR"