projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using --riggid it is possible to get a case where minval is bigger than maxval ....
[rrdtool.git]
/
src
/
rrd_graph.c
diff --git
a/src/rrd_graph.c
b/src/rrd_graph.c
index
ef7c9b6
..
afcbc01
100644
(file)
--- a/
src/rrd_graph.c
+++ b/
src/rrd_graph.c
@@
-1072,6
+1072,11
@@
data_proc( image_desc_t *im ){
else
im->maxval = maxval;
}
else
im->maxval = maxval;
}
+ /* make sure min is smaller than max */
+ if (im->minval > im->maxval) {
+ im->minval = 0.99 * im->maxval;
+ }
+
/* make sure min and max are not equal */
if (im->minval == im->maxval) {
im->maxval *= 1.01;
/* make sure min and max are not equal */
if (im->minval == im->maxval) {
im->maxval *= 1.01;
@@
-2477,11
+2482,11
@@
graph_paint(image_desc_t *im, char ***calcpr)
if (strcmp(im->graphfile,"-")==0) {
if (strcmp(im->graphfile,"-")==0) {
+ fo = im->graphhandle ? im->graphhandle : stdout;
#ifdef WIN32
/* Change translation mode for stdout to BINARY */
#ifdef WIN32
/* Change translation mode for stdout to BINARY */
- _setmode( _fileno(
stdout
), O_BINARY );
+ _setmode( _fileno(
fo
), O_BINARY );
#endif
#endif
- fo = stdout;
} else {
if ((fo = fopen(im->graphfile,"wb")) == NULL) {
rrd_set_error("Opening '%s' for write: %s",im->graphfile,
} else {
if ((fo = fopen(im->graphfile,"wb")) == NULL) {
rrd_set_error("Opening '%s' for write: %s",im->graphfile,
@@
-2569,12
+2574,13
@@
scan_for_col(char *input, int len, char *output)
** - script parsing now in rrd_graph_script()
*/
int
** - script parsing now in rrd_graph_script()
*/
int
-rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize)
+rrd_graph(int argc, char **argv, char ***prdata, int *xsize, int *ysize
, FILE *stream
)
{
image_desc_t im;
rrd_graph_init(&im);
{
image_desc_t im;
rrd_graph_init(&im);
-
+ im.graphhandle = stream;
+
rrd_graph_options(argc,argv,&im);
if (rrd_test_error()) {
im_free(&im);
rrd_graph_options(argc,argv,&im);
if (rrd_test_error()) {
im_free(&im);