#include "include/conf.h"
#include "include/defs.h"
+#include "include/filelist.h"
//! The global statistics of the whole log read.
struct globalstatstruct globstat;
//! \c True to enable the smart filter.
bool smartfilter=false;
+extern FileListObject UserAgentLog;
+
//! 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.
void gerarel(void)
{
- FILE *fp_in;
+ FileObject *fp_in;
FILE *fp_gen;
FILE *fp_tmp=NULL;
debugaz(__FILE__,__LINE__,_("outdirname=%s\n"),outdirname);
}
- if(UserAgentLog[0] != '\0' && email[0] == '\0') useragent();
+ if (!FileList_IsEmpty(UserAgentLog) && email[0] == '\0') useragent();
snprintf(wdirname,sizeof(wdirname),"%s/sarg-general",outdirname);
if((fp_gen=MY_FOPEN(wdirname,"w"))==NULL){
debuga_more("%s/%s.user_log\n",tmp,uinfo->filename);
exit(EXIT_FAILURE);
}
- if((fp_in=MY_FOPEN(tmp3,"r"))==NULL){
- debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
+ if((fp_in=FileObject_Open(tmp3))==NULL){
+ debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),tmp3,FileObject_GetLastOpenError());
exit(EXIT_FAILURE);
}
user=uinfo->filename;
strcpy(oldaccdia,accdia);
strcpy(oldacchora,acchora);
}
- if (fclose(fp_in)==EOF) {
- debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),tmp3,strerror(errno));
+ if (FileObject_Close(fp_in)) {
+ debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),tmp3,FileObject_GetLastCloseError());
exit(EXIT_FAILURE);
}
longline_destroy(&line);