From: Tyrel D. <ty...@us...> - 2013-09-11 23:54:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gather - Metric Data Gatherer". The branch, master has been updated via e70a1b2a87439737581d0a8e404cc9952b2e644c (commit) from 3835ad76a630fef17cc4733360912a74a4af8d02 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e70a1b2a87439737581d0a8e404cc9952b2e644c Author: Tyrel Datwyler <ty...@li...> Date: Wed Sep 11 16:29:20 2013 -0700 Fixed #2664: no guest counter in /proc/stat on older kernels ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + plugin/repositoryOperatingSystem.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index bb94222..9fc1129 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ Bugs fixed: - #2633 local FS metris calculated inconsitently +- #2664 no guest counter in /proc/stat on older kernels Changes in Version 2.2.8 ======================== diff --git a/plugin/repositoryOperatingSystem.c b/plugin/repositoryOperatingSystem.c index 9719dc8..6e20b17 100644 --- a/plugin/repositoryOperatingSystem.c +++ b/plugin/repositoryOperatingSystem.c @@ -2004,6 +2004,7 @@ unsigned long long os_getCPUStealTime( char * data ) { char * end = NULL; char time[128]; unsigned long long val = 0; + int len_end = 0; if( (hlp = strchr(data, ':')) != NULL ) { hlp++; @@ -2021,7 +2022,9 @@ unsigned long long os_getCPUStealTime( char * data ) { hlp++; end = strchr(hlp, ':'); memset(time,0,sizeof(time)); - strncpy(time, hlp, (strlen(hlp)-strlen(end)) ); + if(end!=NULL) + len_end = strlen(end); + strncpy(time, hlp, (strlen(hlp)-len_end)); val = strtoll(time,(char**)NULL,10)*10; } hooks/post-receive -- gather - Metric Data Gatherer |