]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - grepday.c
Explain the reason when a file cannot be opened
[thirdparty/sarg.git] / grepday.c
index 5dd097dae5b53b6fc51d80b36a6e2dafbbcfadcd..48ea14297b6edb9c6e366591e777a189e0c9b062 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -618,7 +618,7 @@ static void greport_plot(const struct userinfostruct *uinfo,struct PlotStruct *p
                exit(EXIT_FAILURE);
        }
        if((pngout=fopen(graph,"wb"))==NULL) {
-               debuga(_("(grepday) Cannot open log file %s\n"),graph);
+               debuga(_("(grepday) Cannot open log file %s: %s\n"),graph,strerror(errno));
                exit(EXIT_FAILURE);
        }
        gdImagePng(gdata.im, pngout);
@@ -689,7 +689,7 @@ void greport_day(const struct userinfostruct *uinfo)
        }
 
        if((fp_in=fopen(wdirname,"r"))==NULL) {
-               debuga(_("(grepday) Cannot open log file %s\n"),wdirname);
+               debuga(_("(grepday) Cannot open log file %s: %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -735,7 +735,7 @@ void greport_day(const struct userinfostruct *uinfo)
                exit(EXIT_FAILURE);
        }
        if ((fp_ou=fopen(wdirname,"wt"))==NULL) {
-               debuga(_("(grepday) Cannot open output file %s\n"),wdirname);
+               debuga(_("(grepday) Cannot open output file %s: %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
        write_html_head(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Graph report"),HTML_JS_NONE);