*/
void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, const char *splitprefix)
{
- FILE *fp_in;
+ FileObject *fp_in;
FILE *fp_ou=NULL;
char *buf;
char data[30];
if(arq[0] == '\0')
arq="/var/log/squid/access.log";
- if((fp_in=MY_FOPEN(arq,"r"))==NULL) {
- debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
+ if((fp_in=FileObject_Open(arq))==NULL) {
+ debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),arq,FileObject_GetLastOpenError());
exit(EXIT_FAILURE);
}
}
longline_destroy(&line);
- if (fclose(fp_in)==EOF) {
- debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),arq,strerror(errno));
+ if (FileObject_Close(fp_in)) {
+ debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),arq,FileObject_GetLastCloseError());
exit(EXIT_FAILURE);
}
if (autosplit && fp_ou) {