summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97418e9)
raw | patch | inline | side by side (parent: 97418e9)
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) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@557 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_open.c | patch | blob | history |
diff --git a/src/rrd_open.c b/src/rrd_open.c
index ff68ca42cea741877f8fdbd8773aec6027fe7b22..7b1a0f1da50f333cc570ef27c5d3821e3c6b0700 100644 (file)
--- a/src/rrd_open.c
+++ b/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 ... */