--- cacti-0.8.5a/cactid/rrd.c 2004-04-01 17:48:03.000000000 -0500 +++ cacti-0.8.6/cactid/rrd.c 2004-04-03 17:23:58.000000000 -0500 @@ -35,11 +35,18 @@ FILE *rrdtool_stdin; void rrd_open() { - rrdtool_stdin = popen(rrdtool_path, "w"); + if ((rrdtool_stdin = popen(rrdtool_path, "w")) == NULL) { + printf("Failed to open the RRDTool pipe at: %s\n", rrdtool_path); + exit(1); + } } void rrd_close() { + if (rrdtool_stdin) { pclose(rrdtool_stdin); + }else{ + printf("RRDTool pipe closed prematurely\n"); + } } void rrd_cmd(char *rrdcmd) {