The return status of every written file is checked when the file is closed.
Any incorrectly written file should be detected early and a proper message
should be reported.
fputc(line[i],fp_auth);
}
}
- fclose(fp_auth);
+ if (fclose(fp_auth)==EOF) {
+ debuga(_("Write error in %s: %s\n"),htname,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fclose(fp_in);
return;
{
if (fp_authfail)
{
- if (fclose(fp_authfail)==EOF)
- {
+ if (fclose(fp_authfail)==EOF) {
debuga(_("Write error in %s: %s\n"),authfail_unsort,strerror(errno));
exit(EXIT_FAILURE);
}
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);
+ }
if (!KeepTempLog && unlink(authfail_sort)) {
debuga(_("Cannot delete %s - %s\n"),authfail_sort,strerror(errno));
*/
void authfail_cleanup(void)
{
- if (fp_authfail)
- {
- fclose(fp_authfail);
+ if (fp_authfail) {
+ if (fclose(fp_authfail)==EOF) {
+ debuga(_("Write error in %s: %s\n"),authfail_unsort,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fp_authfail=NULL;
}
if(authfail_unsort[0]) {
longline_destroy(&line);
if (fclose(fp_in)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),arq,strerror(errno));
+ debuga(_("Failed to close file %s: %s\n"),arq,strerror(errno));
+ exit(EXIT_FAILURE);
}
}
if(fp_in) fclose(fp_in);
if(fp_guard) fclose(fp_guard);
- if(fp_ou) fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s"),guard_in,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(debug)
debuga(_("Sorting file: %s\n"),guard_ou);
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);
+ }
if (!KeepTempLog && unlink(dansguardian_in)) {
debuga(_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
}
userinfo_stopscan(uscan);
if (oldurl) free(oldurl);
- if (fp_ou) fclose(fp_ou);
+ if (fp_ou && fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),DataFile,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(debug)
debuga(_("Datafile %s written successfully\n"),DataFile);
*/
void denied_close(void)
{
- if (fp_denied)
- {
- if (fclose(fp_denied)==EOF)
- {
+ if (fp_denied) {
+ if (fclose(fp_denied)==EOF) {
debuga(_("Write error in %s: %s\n"),denied_unsort,strerror(errno));
exit(EXIT_FAILURE);
}
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)<0)
- 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);
+ }
if (!KeepTempLog && unlink(denied_sort)==-1)
debuga(_("Cannot delete \"%s\": %s\n"),denied_sort,strerror(errno));
*/
void denied_cleanup(void)
{
- if (fp_denied)
- {
- fclose(fp_denied);
+ if (fp_denied){
+ if (fclose(fp_denied)==EOF) {
+ debuga(_("Write error in %s: %s\n"),denied_unsort,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fp_denied=NULL;
}
if (!KeepTempLog && denied_unsort[0]) {
{
if (fp_download)
{
- if (fclose(fp_download)==EOF)
- {
+ if (fclose(fp_download)==EOF) {
debuga(_("Write error in %s: %s\n"),download_unsort,strerror(errno));
exit(EXIT_FAILURE);
}
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);
+ }
if (!KeepTempLog && unlink(report_in)) {
debuga(_("Cannot delete \"%s\": %s\n"),report_in,strerror(errno));
*/
void download_cleanup(void)
{
- if (fp_download)
- {
- fclose(fp_download);
+ if (fp_download) {
+ if (fclose(fp_download)==EOF) {
+ debuga(_("Write error in %s: %s\n"),download_unsort,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fp_download=NULL;
}
if (download_unsort[0]) {
ttnelap+=tnelap;
}
- fclose(fp_top2);
+ if (fclose(fp_top2)==EOF) {
+ debuga(_("Write error in %s: %s\n"),top2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttnelap!=globstat.elap) {
local = localtime(&t);
fprintf(fp_top3, "\n%s\n", asctime(local));
- fclose(fp_top3);
+ if (fclose(fp_top3)==EOF) {
+ debuga(_("Write error in %s: %s\n"),top3,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(strcmp(email,"stdout") == 0) {
if((fp_top3=fopen(top3,"r"))==NULL) {
exit(EXIT_FAILURE);
}
gdImagePng(gdata.im, pngout);
- fclose(pngout);
+ if (fclose(pngout)==EOF) {
+ debuga(_("Write error in %s: %s\n"),graph,strerror(errno));
+ }
gdImageDestroy(gdata.im);
if (gdata.string) free(gdata.string);
if (write_html_trailer(fp_ou)<0)
debuga(_("Write error in file %s\n"),wdirname);
if (fclose(fp_ou)==EOF)
- debuga(_("Failed to close file %s - %s\n"),wdirname,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
#endif //HAVE_GD
return;
longline_destroy(&line1);
fclose(fp_ip);
- fclose(fp_ip2);
+ if (fclose(fp_ip2)==EOF) {
+ debuga(_("Write error in %s: %s\n"),tmp2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if (snprintf(csort,sizeof(csort),"sort -n -t \"\t\" -T \"%s\" -k 1,1 -k 2,2 -o \"%s\" \"%s\"",tmp,tmp3,tmp2)>=sizeof(csort)) {
debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),tmp2,tmp3);
exit(EXIT_FAILURE);
}
fprintf(fp_usr,"%s\n",uinfo->label);
- fclose(fp_usr);
+ if (fclose(fp_usr)==EOF) {
+ debuga(_("Write error in %s: %s\n"),PerUserLimitFile,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(debug)
debuga(_("User %s limit exceeded (%d MB). Added to file %s\n"),uinfo->label,PerUserLimit,PerUserLimitFile);
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
debuga(_("Write error in file %s\n"),arqou);
- if (fclose(fp_ou)==EOF)
- debuga(_("Failed to close file %s - %s\n"),arqou,strerror(errno));
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),arqou,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
htaccess(uinfo);
}
char code2[MAXLEN];
char tmp[MAXLEN];
char parse_out[MAXLEN];
-char arqtt[MAXLEN];
char html[MAXLEN];
char ConfigFile[MAXLEN];
char df;
fputs("</table></div>\n",fp_ou3);
if (write_html_trailer(fp_ou3)<0)
debuga(_("Write error in the index %s\n"),dayindex);
- if (fclose(fp_ou3)==EOF)
- debuga(_("Failed to close the index file %s - %s\n"),dayindex,strerror(errno));
+ if (fclose(fp_ou3)==EOF) {
+ debuga(_("Write error in %s: %s\n"),dayindex,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
fputs("</table></div>\n",fp_ou2);
if (write_html_trailer(fp_ou2)<0)
debuga(_("Write error in the index %s\n"),monthindex);
- if (fclose(fp_ou2)==EOF)
- debuga(_("Failed to close the index file %s - %s\n"),monthindex,strerror(errno));
+ if (fclose(fp_ou2)==EOF) {
+ debuga(_("Write error in %s: %s\n"),monthindex,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
debuga(_("Write error in the index %s\n"),yearindex);
- if (fclose(fp_ou)==EOF)
- debuga(_("Failed to close the index file %s - %s\n"),yearindex,strerror(errno));
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),yearindex,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
static void make_file_index(void)
}
closedir( dirp );
- fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),temp,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
snprintf(buf,sizeof(buf),"sort -n -t \"\t\" -k 1,1 -o \"%slastlog\" \"%s\"",outdir,temp);
cstatus=system(buf);
if (ufile1->file!=NULL) {
if (x>=maxopenfiles) {
if (fclose(ufile1->file)==EOF) {
- debuga(_("Failed to close the log file of user %s - %s\n"),ufile1->user->id,strerror(errno));
+ debuga(_("Write error in the log file of user %s: %s\n"),ufile1->user->id,strerror(errno));
exit(EXIT_FAILURE);
}
ufile1->file=NULL;
char val2[40];
char val4[255];//val4 must not be bigger than arq_log without fixing the strcpy below
- fclose(fp_log);
+ if (fclose(fp_log)==EOF) {
+ debuga(_("Write error in %s: %s\n"),arq_log,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
safe_strcpy(end_hour,tbuf2,sizeof(end_hour));
strftime(val2,sizeof(val2),"%d%m%Y",&period.start);
strftime(val1,sizeof(val1),"%d%m%Y",&period.end);
for (ufile=first_user_file ; ufile ; ufile=ufile1) {
ufile1=ufile->next;
- if (ufile->file!=NULL) fclose(ufile->file);
+ if (ufile->file!=NULL && fclose(ufile->file)==EOF) {
+ debuga(_("Write error in the log file of user %s: %s\n"),ufile->user->id,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
free(ufile);
}
}
if (fp_guard) fclose(fp_guard);
- if (fp_ou) fclose(fp_ou);
+ if (fp_ou && fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),guard_in,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if (files_done) {
for (y=0; y<nfiles_done; y++)
fputs("</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);
+ }
if (!KeepTempLog && unlink(redirector_sorted)) {
debuga(_("Cannot delete \"%s\": %s\n"),redirector_sorted,strerror(errno));
if (write_html_trailer(fp_ou)<0)
debuga(_("Write error in file %s\n"),arqout);
- if (fclose(fp_ou)==EOF)
- debuga(_("Failed to close file %s - %s\n"),arqout,strerror(errno));
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),arqout,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
return;
}
//! \c True to enable the smart filter.
bool smartfilter=false;
+//! The file to store the HTML page where the time of access is reported for one site and one user.
static FILE *fp_tt=NULL;
+//! The name of the file containing the access time of the site/user.
+static char arqtt[4096]="";
static FILE *maketmp(const char *user, const char *dirname, int debug);
static void gravatmp(FILE *fp_ou, const char *oldurl, long long int nacc, long long int nbytes, const char *oldmsg, long long int nelap, long long int incache, long long int oucache);
char accsmart[MAXLEN];
char crc2[MAXLEN/2 -1];
char siteind[MAX_TRUNCATED_URL];
- char arqtt[256];
char *oldurltt=NULL;
char oldaccdiatt[11],oldacchoratt[9];
char tmp3[MAXLEN];
day_totalize(daystat,tmp,uinfo);
}
if (fp_tmp) {
- if (fclose(fp_tmp)==EOF)
- debuga(_("Failed to close temporary file for user %s - %s\n"),uinfo->filename,strerror(errno));
+ if (fclose(fp_tmp)==EOF) {
+ debuga(_("Failed to close temporary file for user %s: %s\n"),uinfo->filename,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fp_tmp=NULL;
}
if (!KeepTempLog && unlink(tmp3)) {
day_cleanup(daystat);
totalger(fp_gen,wdirname);
- fclose(fp_gen);
+ if (fclose(fp_gen)==EOF) {
+ debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(email[0] == '\0') {
if (!indexonly) {
if(fp_tt) {
fputs("</table>\n</div>\n",fp_tt);
fputs("</body>\n</html>\n",fp_tt);
- fclose(fp_tt);
+ if (fclose(fp_tt)==EOF) {
+ debuga(_("Write error in %s: %s\n"),arqtt,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
fp_tt=NULL;
}
*/
fprintf(fp_ou,"%s\t%s\t%s\t%s\t%"PRIu64"\t%"PRIu64"\n",ip,url,data,hora,(uint64_t)tam,(uint64_t)elap);
- fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
return;
}
fprintf(fp_ou,"%s\t%s\t%s\t%s\t%s\t%s\n",user,data,hora,ip,url,smart);
fputs("</body>\n</html>\n",fp_tt);
- fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
return;
}
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;
}
char smartcat[256];
char ftime[128];
char smartuser[MAXLEN];
- int fuser=0;
int cstatus;
struct getwordstruct gwarea;
const struct userinfostruct *uinfo;
if(strcmp(ouser,user) != 0) {
strcpy(ouser,user);
sprintf(smartuser,"%s/denied_%s.html",outdirname,uinfo->filename);
- if(fuser) {
- fuser=0;
+ if (fp_user) {
fputs("</table>\n",fp_user);
if(ShowSargInfo) {
zdate(ftime, sizeof(ftime), df);
fprintf(fp_user,"<br><br><div align=\"center\"><font size=\"-2\">%s <a href=\"%s\">%s-%s</a> %s %s</font></div>\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime);
}
fputs("</body>\n</html>\n",fp_user);
- fclose(fp_user);
+ if (fclose(fp_user)==EOF) {
+ debuga(_("Write error in %s: %s\n"),smartuser,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ fp_user=NULL;
}
if ((fp_user = fopen(smartuser, "a")) == 0) {
debuga(_("(smartfilter) Cannot open file %s: %s\n"),smartuser,strerror(errno));
exit(EXIT_FAILURE);
}
- fuser=1;
fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"",fp_ou);
fputs(" \"http://www.w3.org/TR/html4/loose.dtd\">\n",fp_ou);
fputs("</body>\n</html>\n",fp_user);
- fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),report,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if(fp_user) {
fputs("</table>\n",fp_user);
if(ShowSargInfo) {
fprintf(fp_user,"<br><br><div align=\"center\"><font size=\"-2\">%s <a href=\"%s\">%s-%s</a> %s %s</font></div>\n",_("Generated by"),URL,PGM,VERSION,_("on"),ftime);
}
fputs("</body>\n</html>\n",fp_user);
- fclose(fp_user);
+ if (fclose(fp_user)==EOF) {
+ debuga(_("Write error in %s: %s\n"),smartuser,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
}
if (!KeepTempLog && unlink(smart_ou)) {
prev_month=t->tm_mon;
prev_day=t->tm_mday;
if (fp_ou && fclose(fp_ou)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),output_file,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),output_file,strerror(errno));
exit(EXIT_FAILURE);
}
strftime(output_file+output_prefix_len, sizeof(output_file)-output_prefix_len, "-%Y-%m-%d", t);
}
if (autosplit && fp_ou) {
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),output_file,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),output_file,strerror(errno));
exit(EXIT_FAILURE);
}
}
free(ourl);
}
- fclose(fp_ou);
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),general3,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttntime!=globstat.elap) {
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;
}
exit(EXIT_FAILURE);
}
fprintf(fp_ou,"%d\n",totuser);
- if (fclose(fp_ou)==EOF)
- debuga(_("Failed to close file %s - %s\n"),tusr,strerror(errno));
+ if (fclose(fp_ou)==EOF) {
+ debuga(_("Write error in %s: %s\n"),tusr,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
globstat.totuser=totuser;
}
ttnincache+=tnincache;
ttnoucache+=tnoucache;
}
- fclose(fp_top2);
+ if (fclose(fp_top2)==EOF) {
+ debuga(_("Write error in %s: %s\n"),top2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
#ifdef ENABLE_DOUBLE_CHECK_DATA
if (ttnacc!=globstat.nacc || ttnbytes!=globstat.nbytes || ttnelap!=globstat.elap ||
if ((ReportType & REPORT_TYPE_TOPUSERS) == 0) {
fputs("</body>\n</html>\n",fp_top3);
- fclose (fp_top3);
+ if (fclose (fp_top3)==EOF) {
+ debuga(_("Write error in %s: %s\n"),top3,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if (debugz) debugaz(_("No top users report because it is not configured in report_type\n"));
return;
}
fputs("</table></div>\n",fp_top3);
if (write_html_trailer(fp_top3)<0)
debuga(_("Write error in top user list %s\n"),top3);
- if (fclose(fp_top3)==EOF)
- debuga(_("Failed to close the top user list %s - %s\n"),top3,strerror(errno));
+ if (fclose(fp_top3)==EOF) {
+ debuga(_("Write error in %s: %s\n"),top3,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
return;
}
}
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),arqout,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),arqout,strerror(errno));
exit(EXIT_FAILURE);
}
return;
fclose(fp_in);
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),tmp3,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),tmp3,strerror(errno));
exit(EXIT_FAILURE);
}
fclose(fp_in);
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to close file %s - %s\n"),tmp3,strerror(errno));
+ debuga(_("Write error in %s: %s\n"),tmp3,strerror(errno));
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ht);
if (write_html_trailer(fp_ht)<0)
debuga(_("Write error in file %s\n"),hfile);
- if (fclose(fp_ht)==EOF)
- debuga(_("Failed to close file %s - %s\n"),hfile,strerror(errno));
+ if (fclose(fp_ht)==EOF) {
+ debuga(_("Write error in %s: %s\n"),hfile,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
if (!KeepTempLog && unlink(tmp3)) {
debuga(_("Cannot delete \"%s\": %s\n"),tmp3,strerror(errno));
break;
}
}
- fclose(img_ou);
+ if (fclose(img_ou)==EOF) {
+ debuga(_("Error while copying image %s: %s\n"),dstfile,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
} else
fprintf(stderr,"SARG: (util): %s %s: %s\n", _("Cannot open file")?_("Cannot open file"):"Can't open/create file", dstfile, strerror(errno));
fclose(img_in);
exit(EXIT_FAILURE);
}
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to write the date in %s\n"),wdir);
- perror("SARG:");
+ debuga(_("Failed to write the date in %s: %s\n"),wdir,strerror(errno));
exit(EXIT_FAILURE);
}
}
totalger(fp_gen,filename);
if (fclose(fp_gen)==EOF) {
- debuga(_("Failed to close %s after writing the total line - %s\n"),filename,strerror(errno));
+ debuga(_("Failed to close %s after writing the total line: %s\n"),filename,strerror(errno));
exit(EXIT_FAILURE);
}
}