]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - topsites.c
Output only two sets of messages when fclose fails
[thirdparty/sarg.git] / topsites.c
index 664e25daeeefaff6a5b8090f955d1e521a6b9a7d..a41558f823c19f01836742488272a016219167dc 100644 (file)
@@ -162,7 +162,10 @@ void topsites(void)
                ttntime+=item.nelap;
 #endif
        }
-       fclose(fp_in);
+       if (fclose(fp_in)==EOF) {
+               debuga(_("Read error in \"%s\": %s\n"),general2,strerror(errno));
+               exit(EXIT_FAILURE);
+       }
        longline_destroy(&line);
 
        if (ourl) {
@@ -316,7 +319,10 @@ void topsites(void)
                if (SortTableJs[0]) fprintf(fp_ou," sorttable_customkey=\"%d\"",nusers);
                fprintf(fp_ou,">%s</td></tr>\n",fixnum(nusers,1));
        }
-       fclose(fp_in);
+       if (fclose(fp_in)==EOF) {
+               debuga(_("Read error in \"%s\": %s\n"),sites,strerror(errno));
+               exit(EXIT_FAILURE);
+       }
        longline_destroy(&line);
 
        fputs("</table></div>\n",fp_ou);