prepare for the release of rrdtool-1.2.9
[rrdtool.git] / src / rrd_update.c
index 5411840..95e9271 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2.5  Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2.9  Copyright by Tobi Oetiker, 1997-2005
  *****************************************************************************
  * rrd_update.c  RRD Update Function
  *****************************************************************************
@@ -13,7 +13,7 @@
  #include <sys/mman.h>
 #endif
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
  #include <sys/locking.h>
  #include <sys/stat.h>
  #include <io.h>
@@ -25,7 +25,7 @@
 #include "rrd_is_thread_safe.h"
 #include "unused.h"
 
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
 /*
  * WIN32 does not have gettimeofday    and struct timeval. This is a quick and dirty
  * replacement.
@@ -95,7 +95,7 @@ int
 main(int argc, char **argv){
         rrd_update(argc,argv);
         if (rrd_test_error()) {
-                printf("RRDtool 1.2.5  Copyright by Tobi Oetiker, 1997-2005\n\n"
+                printf("RRDtool " PACKAGE_VERSION "  Copyright by Tobi Oetiker, 1997-2005\n\n"
                         "Usage: rrdupdate filename\n"
                         "\t\t\t[--template|-t ds-name:ds-name:...]\n"
                         "\t\t\ttime|N:value[:value...]\n\n"
@@ -252,9 +252,9 @@ _rrd_update(char *filename, char *template, int argc, char **argv,
 
     FILE             *rrd_file;
     rrd_t            rrd;
-    time_t           current_time;
-       time_t           rra_time; /* time of update for a RRA */
-    unsigned long    current_time_usec;  /* microseconds part of current time */
+    time_t           current_time = 0;
+    time_t           rra_time = 0;      /* time of update for a RRA */
+    unsigned long    current_time_usec=0;/* microseconds part of current time */
     struct timeval   tmp_time;           /* used for time conversion */
 
     char             **updvals;
@@ -1433,7 +1433,7 @@ LockRRD(FILE *rrdfile)
     rrd_fd = fileno(rrdfile);
 
        {
-#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
     struct _stat st;
 
     if ( _fstat( rrd_fd, &st ) == 0 ) {