Code

avoid problems when building with VPATH set and --disable-perl
[rrdtool-all.git] / program / src / rrd_open.c
index 2b0f30391d35fad220ca1e91b9190add9422a86a..11476de43cb85bcec38ceb56cab7a42da86454c9 100644 (file)
@@ -107,7 +107,7 @@ rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr)
 
     MYFREAD(rrd->stat_head, stat_head_t,  1)
     /* lets see if the first read worked */
-    if (ferror( *in_file )){
+    if (ferror( *in_file ) || feof(*in_file)) {
        rrd_set_error("reading the cookie off %s faild",file_name);
        fclose(*in_file);
        return(-1);