summaryrefslogtreecommitdiff
path: root/flist.c
diff options
context:
space:
mode:
authorJ.W. Schultz <jw@samba.org>2003-09-16 02:49:59 +0000
committerJ.W. Schultz <jw@samba.org>2003-09-16 02:49:59 +0000
commit6a7cc46cb279b9dbf12977177330aeebb912aa34 (patch)
tree6e3b7760f73eb3610228467999714af25378f3d4 /flist.c
parentaa6dc37ccb73c83f652e72ed1ca7700934a52331 (diff)
downloadrsync-6a7cc46cb279b9dbf12977177330aeebb912aa34.tar.gz
Detect and report when open or opendir succeed but read and
readdir fail caused by network filesystems issues and truncated files. Thanks to David Norwood and Michael Brown
Diffstat (limited to 'flist.c')
-rw-r--r--flist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/flist.c b/flist.c
index b5ccbf56..8bc3ab37 100644
--- a/flist.c
+++ b/flist.c
@@ -877,14 +877,19 @@ static void send_directory(int f, struct file_list *flist, char *dir)
}
}
- for (di = readdir(d); di; di = readdir(d)) {
+ for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {
char *dname = d_name(di);
- if (dname[0] == '.' && (dname[1] == '\0' ||
- (dname[1] == '.' && dname[2] == '\0')))
+ if (dname[0] == '.' && (dname[1] == '\0'
+ || (dname[1] == '.' && dname[2] == '\0')))
continue;
strlcpy(p, dname, MAXPATHLEN - l);
send_file_name(f, flist, fname, recurse, 0);
}
+ if (errno) {
+ io_error = 1;
+ rprintf(FERROR, "readdir(%s): (%d) %s\n",
+ dir, errno, strerror(errno));
+ }
if (local_exclude_list)
free_exclude_list(&local_exclude_list); /* Zeros pointer too */