Code

reset errno right befor the place where we look at it ...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 22 May 2009 14:55:40 +0000 (14:55 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Fri, 22 May 2009 14:55:40 +0000 (14:55 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3/program@1807 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_update.c

index 1716a5b184d16b32ec0aff7d8ab28e47694760b7..36a7e1dbf55d761cfe59b5a1bd776d9fc298a881 100644 (file)
@@ -1060,8 +1060,8 @@ static int update_pdp_prep(
                 rate = pdp_new[ds_idx] / interval;
                 break;
             case DST_GAUGE:
-                errno = 0;
                 old_locale = setlocale(LC_NUMERIC, "C");
+                errno = 0;
                 pdp_new[ds_idx] =
                     strtod(updvals[ds_idx + 1], &endptr) * interval;
                 if (errno) {
@@ -1955,6 +1955,7 @@ static int write_RRA_row(
                                            rrd->ds_def[ds_idx].ds_nam),
                                           RD_I_VAL, iv);
         }
+        errno = 0;
         if (rrd_write(rrd_file,
                       &(rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].
                         u_val), sizeof(rrd_value_t)) != sizeof(rrd_value_t)) {