Merge pull request #1014 from mfournier/fix-path-to-java
authorMarc Fournier <marc.fournier@camptocamp.com>
Tue, 5 May 2015 19:40:09 +0000 (21:40 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 5 May 2015 19:40:09 +0000 (21:40 +0200)
improve java detection/defaults in configure script

configure.in
contrib/redhat/collectd.spec
src/processes.c
src/swap.c

index 12874a2..234ebf7 100644 (file)
@@ -1161,6 +1161,7 @@ FILE *fh;
 struct mntent *me;
 fh = setmntent ("/etc/mtab", "r");
 me = getmntent (fh);
+return(me->mnt_passno);
 ]]]
                        )],
                        [c_cv_have_one_getmntent="yes"],
@@ -1180,6 +1181,7 @@ me = getmntent (fh);
                                 int status;
                                 fh = fopen ("/etc/mnttab", "r");
                                 status = getmntent (fh, &mt);
+                                return(status);
 ]]]
                        )],
                        [c_cv_have_two_getmntent="yes"],
@@ -3046,6 +3048,7 @@ then
 ]]],
 [[[
   int val = PCAP_ERROR_IFACE_NOT_UP;
+  return(val);
 ]]]
                       )],
                       [c_cv_libpcap_have_pcap_error_iface_not_up="yes"],
index ce715ea..e9e71d6 100644 (file)
 # plugin zfs_arc disabled, requires FreeBSD/Solaris
 %define with_zfs_arc 0%{!?_without_zfs_arc:0}
 
-Summary:       Statistics collection daemon for filling RRD files
+Summary:       statistics collection and monitoring daemon
 Name:          collectd
 Version:       5.3.2
 Release:       1%{?dist}
@@ -770,7 +770,7 @@ Development files for libcollectdclient
 %if %{with_dbi}
 %define _with_dbi --enable-dbi
 %else
-%define _with_dbi --disable-dbi --without-libdbi
+%define _with_dbi --disable-dbi
 %endif
 
 %if %{with_df}
@@ -992,7 +992,7 @@ Development files for libcollectdclient
 %if %{with_notify_email}
 %define _with_notify_email --enable-notify_email
 %else
-%define _with_notify_email --disable-notify_email --without-libesmpt
+%define _with_notify_email --disable-notify_email
 %endif
 
 %if %{with_ntpd}
@@ -1040,7 +1040,7 @@ Development files for libcollectdclient
 %if %{with_perl}
 %define _with_perl --enable-perl --with-perl-bindings="INSTALLDIRS=vendor"
 %else
-%define _with_perl --disable-perl --without-libperl
+%define _with_perl --disable-perl
 %endif
 
 %if %{with_pf}
@@ -1272,13 +1272,13 @@ Development files for libcollectdclient
 %if %{with_write_mongodb}
 %define _with_write_mongodb --enable-write_mongodb
 %else
-%define _with_write_mongodb --disable-write_mongodb --without-libmongoc
+%define _with_write_mongodb --disable-write_mongodb
 %endif
 
 %if %{with_write_redis}
 %define _with_write_redis --enable-write_redis
 %else
-%define _with_write_redis --disable-write_redis --without-libcredis
+%define _with_write_redis --disable-write_redis
 %endif
 
 %if %{with_write_riemann}
@@ -1666,7 +1666,7 @@ fi
 %if %{with_thermal}
 %{_libdir}/%{name}/thermal.so
 %endif
-%if %{with_load}
+%if %{with_threshold}
 %{_libdir}/%{name}/threshold.so
 %endif
 %if %{with_unixsock}
index c77859d..d6b4845 100644 (file)
@@ -1787,7 +1787,7 @@ static int ps_read (void)
        int wait     = 0;
 
        kvm_t *kd;
-       char errbuf[1024];
+       char errbuf[_POSIX2_LINE_MAX];
        struct kinfo_proc *procs;          /* array of processes */
        struct kinfo_proc *proc_ptr = NULL;
        int count;                         /* returns number of processes */
@@ -1799,7 +1799,7 @@ static int ps_read (void)
        ps_list_reset ();
 
        /* Open the kvm interface, get a descriptor */
-       kd = kvm_open (NULL, NULL, NULL, 0, errbuf);
+       kd = kvm_openfiles (NULL, "/dev/null", NULL, 0, errbuf);
        if (kd == NULL)
        {
                ERROR ("processes plugin: Cannot open kvm interface: %s",
index 1621f7a..fb50cf3 100644 (file)
@@ -160,6 +160,8 @@ static int swap_init (void) /* {{{ */
 /* #endif defined(VM_SWAPUSAGE) */
 
 #elif HAVE_LIBKVM_GETSWAPINFO
+       char errbuf[_POSIX2_LINE_MAX];
+
        if (kvm_obj != NULL)
        {
                kvm_close (kvm_obj);
@@ -168,14 +170,11 @@ static int swap_init (void) /* {{{ */
 
        kvm_pagesize = getpagesize ();
 
-       if ((kvm_obj = kvm_open (NULL, /* execfile */
-                                       NULL, /* corefile */
-                                       NULL, /* swapfile */
-                                       O_RDONLY, /* flags */
-                                       NULL)) /* errstr */
-                       == NULL)
+       kvm_obj = kvm_openfiles (NULL, "/dev/null", NULL, O_RDONLY, errbuf);
+
+       if (kvm_obj == NULL)
        {
-               ERROR ("swap plugin: kvm_open failed.");
+               ERROR ("swap plugin: kvm_openfiles failed, %s", errbuf);
                return (-1);
        }
 /* #endif HAVE_LIBKVM_GETSWAPINFO */