]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - topsites.c
Explain the reason when a file cannot be opened
[thirdparty/sarg.git] / topsites.c
index 01ef7fdb0ec6fe32b89b42f5441d541891ca1a13..f57bdf35166c234b737d0c41c20ee23f578c8d63 100644 (file)
@@ -92,13 +92,13 @@ void topsites(void)
        }
 
        if((fp_in=fopen(general2,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),general2);
+               debuga(_("(topsites) Cannot open log file %s: %s\n"),general2,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=fopen(general3,"w"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),general3);
+               debuga(_("(topsites) Cannot open log file %s: %s\n"),general3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -214,7 +214,7 @@ void topsites(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(sites,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),sites);
+               debuga(_("(topsites) Cannot open log file %s: %s\n"),sites,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -225,7 +225,7 @@ void topsites(void)
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),report);
+               debuga(_("(topsites) Cannot open log file %s: %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }