From: ale@biancalanas.net Date: Tue, 5 May 2015 02:01:29 +0000 (+0000) Subject: - use _POSIX2_LINE_MAX for errbuf as stated by kvm(3). X-Git-Tag: collectd-5.5.0~12^2~5^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3361d7acbc9d1338db56396f43eae89459d2055d;p=collectd.git - use _POSIX2_LINE_MAX for errbuf as stated by kvm(3). - fix error msg on kvm_openfiles failure --- diff --git a/src/processes.c b/src/processes.c index 6caea54c..d6b48452 100644 --- a/src/processes.c +++ b/src/processes.c @@ -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 */ diff --git a/src/swap.c b/src/swap.c index b3aa4f7d..fb50cf38 100644 --- a/src/swap.c +++ b/src/swap.c @@ -160,7 +160,7 @@ static int swap_init (void) /* {{{ */ /* #endif defined(VM_SWAPUSAGE) */ #elif HAVE_LIBKVM_GETSWAPINFO - char errbuf[1024]; + char errbuf[_POSIX2_LINE_MAX]; if (kvm_obj != NULL) { @@ -174,7 +174,7 @@ static int swap_init (void) /* {{{ */ if (kvm_obj == NULL) { - ERROR ("swap plugin: kvm_open failed, %s", errbuf); + ERROR ("swap plugin: kvm_openfiles failed, %s", errbuf); return (-1); } /* #endif HAVE_LIBKVM_GETSWAPINFO */