]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - siteuser.c
Be more thorough when ensuring a file is correctly written
[thirdparty/sarg.git] / siteuser.c
index 69b15c1a2c058f3ad2be41037328be17001eb57b..9f354ee45476243409408ecf543c912bea0274f9 100644 (file)
@@ -189,8 +189,10 @@ void siteuser(void)
        fputs("</table></div>\n",fp_ou);
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
-       if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+       if (fclose(fp_ou)==EOF) {
+               debuga(_("Write error in %s: %s\n"),report,strerror(errno));
+               exit(EXIT_FAILURE);
+       }
 
        return;
 }