From b9e559815dbbb4a0ef9d836e98b861f7c4c3a5b3 Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 6 Apr 2009 14:08:16 +0000 Subject: [PATCH] lets have an error message when creating the graph fails git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1768 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index eb909522..549e08c7 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -3844,8 +3844,11 @@ int rrd_graph( (*prdata)[prlines] = NULL; strcpy((*prdata)[prlines - 1], walker->value.u_str); } else if (strcmp(walker->key, "image") == 0) { - fwrite(walker->value.u_blo.ptr, walker->value.u_blo.size, 1, - (stream ? stream : stdout)); + if ( fwrite(walker->value.u_blo.ptr, walker->value.u_blo.size, 1, + (stream ? stream : stdout)) == 0 && ferror(stream ? stream : stdout)){ + rrd_set_error("writing image"); + return 0; + } } /* skip anything else */ walker = walker->next; -- 2.30.2