]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - authfail.c
Explain the reason when a file cannot be opened
[thirdparty/sarg.git] / authfail.c
index dd15e69a921fefd6b2326630d27fbb27f5d8e4ca..e10593fdbe9f982bc14e7ebf5818cae38d111685 100644 (file)
@@ -53,7 +53,7 @@ void authfail_open(void)
 
        snprintf(authfail_unsort,sizeof(authfail_unsort),"%s/authfail.int_unsort",tmp);
        if ((fp_authfail=MY_FOPEN(authfail_unsort,"w"))==NULL) {
-               debuga(_("(log) Cannot open file: %s - %s\n"),authfail_unsort,strerror(errno));
+               debuga(_("(log) Cannot open file %s: %s\n"),authfail_unsort,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
@@ -157,7 +157,7 @@ void authfail_report(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=MY_FOPEN(authfail_sort,"r"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s\n"),authfail_sort);
+               debuga(_("(authfail) Cannot open file %s: %s\n"),authfail_sort,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -168,7 +168,7 @@ void authfail_report(void)
        authfail_unsort[0]='\0';
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s\n"),report);
+               debuga(_("(authfail) Cannot open file %s: %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }