summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8eb7f97)
raw | patch | inline | side by side (parent: 8eb7f97)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 16 Nov 2011 16:49:10 +0000 (16:49 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 16 Nov 2011 16:49:10 +0000 (16:49 +0000) |
fix provided in #321
--This line, and those below, will be ignored--
M trunk/program/src/rrd_fetch_libdbi.c
M branches/1.4/program/src/rrd_fetch_libdbi.c
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2208 a5681a0c-68f1-0310-ab6d-d61299d08faa
--This line, and those below, will be ignored--
M trunk/program/src/rrd_fetch_libdbi.c
M branches/1.4/program/src/rrd_fetch_libdbi.c
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2208 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_fetch_libdbi.c | patch | blob | history |
diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c
index 6a220260463324d5d60c7af9bdbe1984210233a4..21fbc083c7575494adfcf26600f69a4de740a47a 100644 (file)
--- a/src/rrd_fetch_libdbi.c
+++ b/src/rrd_fetch_libdbi.c
unsigned long minstepsize=300;
/* by default assume unixtimestamp */
int isunixtime=1;
+ long gmt_offset=0;
/* the result-set */
long r_timestamp,l_timestamp,d_timestamp;
double r_value,l_value,d_value;
return -1;
}
/* if we have leading '*', then we have a TIMEDATE Field*/
- if (table_help.timestamp[0]=='*') { isunixtime=0; table_help.timestamp++; }
+ if (table_help.timestamp[0]=='*') {
+ struct tm tm;
+ time_t t=time(NULL);
+ localtime_r(&t,&tm);
+ gmt_offset=tm.tm_gmtoff;
+ isunixtime=0; table_help.timestamp++;
+ }
/* hex-unescape the value */
if(_inline_unescape(table_help.timestamp)) { return -1; }
while((r_status=_sql_fetchrow(&table_help,&r_timestamp,&r_value,derive))>0) {
/* processing of value */
/* calculate index for the timestamp */
+ r_timestamp-=gmt_offset;
idx=(r_timestamp-(*start))/(*step);
/* some out of bounds checks on idx */
if (idx<0) { idx=0;}