summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb834fb)
raw | patch | inline | side by side (parent: bb834fb)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 14 May 2005 15:07:35 +0000 (15:07 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sat, 14 May 2005 15:07:35 +0000 (15:07 +0000) |
program/src/rrd_open.c | patch | blob | history |
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index ff68ca42cea741877f8fdbd8773aec6027fe7b22..7b1a0f1da50f333cc570ef27c5d3821e3c6b0700 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
if ((MYVAR = malloc(sizeof(MYVART) * MYCNT)) == NULL) {\
rrd_set_error("" #MYVAR " malloc"); \
fclose(*in_file); \
- return (-1); } \
+ return (-1); } \
fread(MYVAR,sizeof(MYVART),MYCNT, *in_file);
MYFREAD(rrd->stat_head, stat_head_t, 1)
+ /* lets see if the first read worked */
+ if (ferror( *in_file )){
+ rrd_set_error("reading the cookie off %s faild",file_name);
+ fclose(*in_file);
+ return(-1);
+ }
version = atoi(rrd->stat_head->version);
/* lets do some test if we are on track ... */