Print strerror when a system error occurs; add a new function rsyserr
[rsync.git] / exclude.c
index 3b70b4e577f646cb3d581a8f16388e04801436e2..cbf6105f1da4c07cf993efca71fa12bdf21927f5 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -220,7 +220,10 @@ struct exclude_struct **make_exclude_list(char *fname,
        char line[MAXPATHLEN];
        if (!f) {
                if (fatal) {
        char line[MAXPATHLEN];
        if (!f) {
                if (fatal) {
-                       rprintf(FERROR,"%s : %s\n",fname,strerror(errno));
+                       rsyserr(FERROR, errno,
+                                "failed to open %s file %s",
+                                include ? "include" : "exclude",
+                                fname);
                        exit_cleanup(RERR_FILEIO);
                }
                return list;
                        exit_cleanup(RERR_FILEIO);
                }
                return list;