projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make ruby bindings compile with newer ruby versions ... fix for #217
[rrdtool.git]
/
src
/
rrd_restore.c
diff --git
a/src/rrd_restore.c
b/src/rrd_restore.c
index
ab8b138
..
9af8ab0
100644
(file)
--- a/
src/rrd_restore.c
+++ b/
src/rrd_restore.c
@@
-31,7
+31,15
@@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
-#include <unistd.h>
+
+
+#ifndef WIN32
+# include <unistd.h> /* for off_t */
+#else
+ typedef size_t ssize_t;
+ typedef long off_t;
+#endif
+
#include <fcntl.h>
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
# include <io.h>
#include <fcntl.h>
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
# include <io.h>
@@
-132,6
+140,13
@@
static int get_double_from_node(
return (-1);
}
return (-1);
}
+ if (strstr(str_ptr, "NaN") != NULL)
+ {
+ *value = DNAN;
+ xmlFree(str_ptr);
+ return 0;
+ }
+
end_ptr = NULL;
temp = strtod(str_ptr, &end_ptr);
xmlFree(str_ptr);
end_ptr = NULL;
temp = strtod(str_ptr, &end_ptr);
xmlFree(str_ptr);
@@
-695,7
+710,7
@@
static int parse_tag_rra(
}
/* Set the RRA pointer to a random location */
}
/* Set the RRA pointer to a random location */
- cur_rra_ptr->cur_row = random() % cur_rra_def->row_cnt;
+ cur_rra_ptr->cur_row = r
rd_r
andom() % cur_rra_def->row_cnt;
return (status);
} /* int parse_tag_rra */
return (status);
} /* int parse_tag_rra */
@@
-1043,7
+1058,6
@@
int rrd_restore(
{
rrd_t *rrd;
{
rrd_t *rrd;
- srandom((unsigned int) time(NULL) + (unsigned int) getpid());
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */
/* init rrd clean */
optind = 0;
opterr = 0; /* initialize getopt */