From: Frederic Marchal Date: Sun, 26 Apr 2015 12:14:18 +0000 (+0200) Subject: Merge messages about memory shortage. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=720f3529cac925e1fd68e192461cf16554fc07a3;p=thirdparty%2Fsarg.git Merge messages about memory shortage. --- diff --git a/authfail.c b/authfail.c index f1121ad..1d4ccc7 100644 --- a/authfail.c +++ b/authfail.c @@ -184,7 +184,7 @@ void authfail_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),authfail_sort); + debuga(_("Not enough memory to read file \"%s\"\n"),authfail_sort); exit(EXIT_FAILURE); } diff --git a/convlog.c b/convlog.c index f906772..8838733 100644 --- a/convlog.c +++ b/convlog.c @@ -48,7 +48,7 @@ void convlog(const char *arq, char df, int dfrom, int duntil) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the log file %s\n"),arq); + debuga(_("Not enough memory to read file \"%s\"\n"),arq); exit(EXIT_FAILURE); } diff --git a/datafile.c b/datafile.c index 46a9a26..293e245 100644 --- a/datafile.c +++ b/datafile.c @@ -97,7 +97,7 @@ void data_file(char *tmp) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files.\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),tmp3); exit(EXIT_FAILURE); } diff --git a/denied.c b/denied.c index 443d785..6f4d78b 100644 --- a/denied.c +++ b/denied.c @@ -190,7 +190,7 @@ void gen_denied_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the denied accesses\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),denied_sort); exit(EXIT_FAILURE); } diff --git a/download.c b/download.c index 69bc443..41afaed 100644 --- a/download.c +++ b/download.c @@ -225,7 +225,7 @@ void download_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),report_in); exit(EXIT_FAILURE); } diff --git a/email.c b/email.c index c0be2f4..5a52aa9 100644 --- a/email.c +++ b/email.c @@ -72,7 +72,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema totuser=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),wger); + debuga(_("Not enough memory to read file \"%s\"\n"),wger); exit(EXIT_FAILURE); } diff --git a/html.c b/html.c index 113742f..087d807 100644 --- a/html.c +++ b/html.c @@ -167,7 +167,7 @@ void htmlrel(void) have_denied_report=true; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),arqin); + debuga(_("Not enough memory to read file \"%s\"\n"),arqin); exit(EXIT_FAILURE); } @@ -392,7 +392,7 @@ void htmlrel(void) } if ((line1=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),arqip); + debuga(_("Not enough memory to read file \"%s\"\n"),arqip); exit(EXIT_FAILURE); } while((buf=longline_read(fp_ip,line1))!=NULL) { @@ -459,7 +459,7 @@ void htmlrel(void) olduserip[0]='\0'; if ((line1=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),arqip); + debuga(_("Not enough memory to read file \"%s\"\n"),arqip); exit(EXIT_FAILURE); } while((buf=longline_read(fp_ip,line1))!=NULL) { diff --git a/index.c b/index.c index 3075b1a..2975813 100644 --- a/index.c +++ b/index.c @@ -179,7 +179,7 @@ static long long int get_size(char *path,int path_size) dir_allocated+=size; dir_list=realloc(dir_list,dir_allocated); if (!dir_list) { - debuga(_("Not enough memory to recurse into subdirectory\n")); + debuga(_("Not enough memory to recurse into subdirectory \"%s\"\n"),path); exit(EXIT_FAILURE); } } diff --git a/readlog.c b/readlog.c index 41c15fe..f71da4a 100644 --- a/readlog.c +++ b/readlog.c @@ -334,7 +334,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read log file %s\n"),arq); + debuga(_("Not enough memory to read file \"%s\"\n"),arq); exit(EXIT_FAILURE); } diff --git a/realtime.c b/realtime.c index 975d71e..a8d2019 100644 --- a/realtime.c +++ b/realtime.c @@ -187,11 +187,6 @@ void realtime(void) init_usertab(UserTabFile); LogLine_Init(&log_line); - if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the log file\n")); - exit(EXIT_FAILURE); - } - /* * Store one more entry to prepare the memory structure in place and reject it if * it is about the same user and url as the last stored one. @@ -218,6 +213,12 @@ void realtime(void) debuga(_("Cannot open file \"%s\": %s\n"),file_name,strerror(errno)); exit(EXIT_FAILURE); } + + if ((line=longline_create())==NULL) { + debuga(_("Not enough memory to read file \"%s\"\n"),file_name); + exit(EXIT_FAILURE); + } + while((buf=longline_read(fp,line)) != NULL ) { log_entry_status=LogLine_Parse(&log_line,&log_entry,buf); diff --git a/redirector.c b/redirector.c index f7ffbe6..534961e 100644 --- a/redirector.c +++ b/redirector.c @@ -270,7 +270,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the redirector log\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),wentp); exit(EXIT_FAILURE); } @@ -475,7 +475,7 @@ void redirector_report(void) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the processed redirector log\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } diff --git a/report.c b/report.c index be54924..8636e87 100644 --- a/report.c +++ b/report.c @@ -163,7 +163,7 @@ void gerarel(void) oucache=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),tmp3); exit(EXIT_FAILURE); } diff --git a/siteuser.c b/siteuser.c index 653fe58..cf0a073 100644 --- a/siteuser.c +++ b/siteuser.c @@ -109,7 +109,7 @@ void siteuser(void) topuser_link=((ReportType & REPORT_TYPE_USERS_SITES) != 0 && !indexonly); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),general2); + debuga(_("Not enough memory to read file \"%s\"\n"),general2); exit(EXIT_FAILURE); } diff --git a/splitlog.c b/splitlog.c index 2273603..0e153dc 100644 --- a/splitlog.c +++ b/splitlog.c @@ -85,7 +85,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the log file %s\n"),arq); + debuga(_("Not enough memory to read file \"%s\"\n"),arq); exit(EXIT_FAILURE); } time(&min_tt); diff --git a/topsites.c b/topsites.c index e161cc0..7573dfe 100644 --- a/topsites.c +++ b/topsites.c @@ -105,7 +105,7 @@ void topsites(void) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),general2); + debuga(_("Not enough memory to read file \"%s\"\n"),general2); exit(EXIT_FAILURE); } @@ -269,7 +269,7 @@ void topsites(void) ntopsites = 0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),sites); + debuga(_("Not enough memory to read file \"%s\"\n"),sites); exit(EXIT_FAILURE); } diff --git a/topuser.c b/topuser.c index 47662cc..68858c4 100644 --- a/topuser.c +++ b/topuser.c @@ -103,7 +103,7 @@ void topuser(void) totuser=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the file %s\n"),wger); + debuga(_("Not enough memory to read file \"%s\"\n"),wger); exit(EXIT_FAILURE); } @@ -309,7 +309,7 @@ void topuser(void) ntopuser = 0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),top1); exit(EXIT_FAILURE); } diff --git a/url.c b/url.c index ac4c1cd..5c20132 100644 --- a/url.c +++ b/url.c @@ -586,7 +586,7 @@ void read_hostalias(const char *Filename) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the host name aliases\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),Filename); exit(EXIT_FAILURE); } diff --git a/userinfo.c b/userinfo.c index 54859c1..7a3e2cd 100644 --- a/userinfo.c +++ b/userinfo.c @@ -330,7 +330,7 @@ void read_useralias(const char *Filename) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the user name aliases\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),Filename); exit(EXIT_FAILURE); }