extern int read_batch;
extern int write_batch;
-static char topsrcname[MAXPATHLEN];
-
static struct exclude_struct **local_exclude_list;
static struct file_struct null_file;
if (l == -1)
return -1;
linkbuf[l] = 0;
- if (copy_unsafe_links && (topsrcname[0] != '\0') &&
- unsafe_symlink(linkbuf, topsrcname)) {
+ if (copy_unsafe_links && unsafe_symlink(linkbuf, path)) {
+ if (verbose > 1) {
+ rprintf(FINFO,"copying unsafe symlink \"%s\" -> \"%s\"\n",
+ path, linkbuf);
+ }
return do_stat(path, buffer);
}
}
if (readlink_stat(fname, &st, linkbuf) != 0) {
int save_errno = errno;
- if ((errno == ENOENT) && copy_links && !noexcludes) {
- /* symlink pointing nowhere, see if excluded */
+ if ((errno == ENOENT) && !noexcludes) {
+ /* either symlink pointing nowhere or file that
+ * was removed during rsync run; see if excluded
+ * before reporting an error */
memset((char *) &st, 0, sizeof(st));
if (check_exclude_file(f, fname, &st)) {
/* file is excluded anyway, ignore silently */
}
for (i = 0; i < argc; i++) {
- char *fname = topsrcname;
+ char fname2[MAXPATHLEN];
+ char *fname = fname2;
strlcpy(fname, argv[i], MAXPATHLEN);
}
}
- topsrcname[0] = '\0';
-
if (f != -1) {
send_file_entry(NULL, f, 0);
}
/*
* allocate a new file list
*/
-struct file_list *flist_new()
+struct file_list *flist_new(void)
{
struct file_list *flist;