Code

Fixed handling of unknown data at PDP build time. There was a long standing
[rrdtool-all.git] / program / src / rrd_update.c
index 7ed95d480f26395422692af47851bd91e0182c70..147e833db09d1b5d05eeb792b1adad4d937dfc28 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2.26  Copyright by Tobi Oetiker, 1997-2007
+ * RRDtool 1.2.27  Copyright by Tobi Oetiker, 1997-2008
  *****************************************************************************
  * rrd_update.c  RRD Update Function
  *****************************************************************************
  */
 #include <sys/timeb.h>
 
-#ifndef __MINGW32__
+#if (defined(__MINGW32__) && \
+       ((__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 12) || __MINGW32_MAJOR_VERSION > 3))
+#include <sys/time.h>
+#else
+
 struct timeval {
        time_t tv_sec; /* seconds */
        long tv_usec;  /* microseconds */
 };
-#endif
-
-#if !(defined(__MINGW32__) && \
-       ((__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 12) || __MINGW32_MAJOR_VERSION > 3))
 
 struct __timezone {
        int  tz_minuteswest; /* minutes W of Greenwich */
@@ -779,7 +779,7 @@ _rrd_update(const char *filename, const char *tmplt, int argc, const char **argv
                     > rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt) || */
                    /* if the interval is larger thatn mrhb we get NAN */
                    (interval > rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt) ||
-                   (occu_pdp_st-proc_pdp_st <= 
+                    (rrd.stat_head -> pdp_step / 2.0 <
                     rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt)) {
                    pdp_temp[i] = DNAN;
                } else {