extern int preserve_gid;
extern int relative_paths;
extern int implied_dirs;
+extern int ignore_perishable;
+extern int non_perishable_cnt;
extern int prune_empty_dirs;
extern int copy_links;
extern int copy_unsafe_links;
static void send_directory(int f, struct file_list *flist,
char *fbuf, int len);
-static char *flist_dir;
+static const char *flist_dir;
static int flist_dir_len;
if (file->link_u.idev) {
if (protocol_version < 26) {
/* 32-bit dev_t and ino_t */
- write_int(f, dev);
- write_int(f, file->F_INODE);
+ write_int(f, (int32)dev);
+ write_int(f, (int32)file->F_INODE);
} else {
/* 64-bit dev_t and ino_t */
if (!(flags & XMIT_SAME_DEV))
#endif
if (always_checksum && (S_ISREG(mode) || protocol_version < 28)) {
- char *sum;
+ const char *sum;
if (S_ISREG(mode))
sum = file->u.sum;
else {
int save_errno = errno;
/* See if file is excluded before reporting an error. */
if (filter_level != NO_FILTERS
- && is_excluded(thisname, 0, filter_level))
+ && (is_excluded(thisname, 0, filter_level)
+ || is_excluded(thisname, 1, filter_level))) {
+ if (ignore_perishable && save_errno != ENOENT)
+ non_perishable_cnt++;
return NULL;
+ }
if (save_errno == ENOENT) {
#ifdef SUPPORT_LINKS
/* Avoid "vanished" error if symlink points nowhere. */
flags |= FLAG_MOUNT_POINT;
}
- if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level))
+ if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
+ if (ignore_perishable)
+ non_perishable_cnt++;
return NULL;
+ }
if (lp_ignore_nonreadable(module_id)) {
#ifdef SUPPORT_LINKS
}
if (dir && *dir) {
- static char *lastdir;
+ static const char *lastdir;
static int lastdir_len;
strlcpy(olddir, curr_dir, sizeof olddir);
}
}
- if (fn != fbuf) {
- if (len >= MAXPATHLEN)
- overflow_exit("send_file_list");
+ if (fn != fbuf)
memmove(fbuf, fn, len + 1);
- }
if (implied_dirs && (p=strrchr(fbuf,'/')) && p != fbuf) {
/* Send the implied directories at the start of the
if (mid_up > high) {
/* If there's nothing left above us, set high to
* a non-empty entry below us and continue. */
- high = mid - flist->files[mid]->length;
+ high = mid - (int)flist->files[mid]->length;
if (!flist->files[high]->basename) {
do {
- high -= flist->files[high]->length;
+ high -= (int)flist->files[high]->length;
} while (!flist->files[high]->basename);
flist->files[mid]->length = mid - high;
}
memset(flist, 0, sizeof (struct file_list));
- if (!(flist->file_pool = pool_create(FILE_EXTENT, 0,
- out_of_memory, POOL_INTERN)))
+ if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, out_of_memory, POOL_INTERN)))
out_of_memory(msg);
#ifdef SUPPORT_HARD_LINKS