Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo pointed out by Chris Pepper.
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
fdfc8dd
..
fb832af
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-4,7
+4,7
@@
* Copyright (C) 1996-2000 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
* Copyright (C) 1996-2000 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
- * Copyright (C) 2003-200
8
Wayne Davison
+ * Copyright (C) 2003-200
9
Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-89,7
+89,6
@@
extern int unsort_ndx;
extern int max_delete;
extern int force_delete;
extern int one_file_system;
extern int max_delete;
extern int force_delete;
extern int one_file_system;
-extern int check_for_io_err;
extern struct stats stats;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
extern struct stats stats;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
@@
-522,7
+521,10
@@
static void delete_in_dir(char *fbuf, struct file_struct *file, dev_t *fs_dev)
f_name(fp, NULL));
continue;
}
f_name(fp, NULL));
continue;
}
- if (flist_find(cur_flist, fp) < 0) {
+ /* Here we want to match regardless of file type. Replacement
+ * of a file with one of another type is handled separately by
+ * a delete_item call with a DEL_MAKE_ROOM flag. */
+ if (flist_find_ignore_dirness(cur_flist, fp) < 0) {
int flags = DEL_RECURSE;
if (!(fp->mode & S_IWUSR) && !am_root && (uid_t)F_OWNER(fp) == our_uid)
flags |= DEL_NO_UID_WRITE;
int flags = DEL_RECURSE;
if (!(fp->mode & S_IWUSR) && !am_root && (uid_t)F_OWNER(fp) == our_uid)
flags |= DEL_NO_UID_WRITE;
@@
-698,7
+700,7
@@
void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
if (iflags & ITEM_XNAME_FOLLOWS)
write_vstring(sock_f_out, xname, strlen(xname));
#ifdef SUPPORT_XATTRS
if (iflags & ITEM_XNAME_FOLLOWS)
write_vstring(sock_f_out, xname, strlen(xname));
#ifdef SUPPORT_XATTRS
- if (preserve_xattrs &&
!dry_run
+ if (preserve_xattrs &&
do_xfers
&& iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
send_xattr_request(NULL, file,
iflags & ITEM_REPORT_XATTR ? sock_f_out : -1);
&& iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
send_xattr_request(NULL, file,
iflags & ITEM_REPORT_XATTR ? sock_f_out : -1);
@@
-1122,8
+1124,8
@@
static int try_dests_non(struct file_struct *file, char *fname, int ndx,
}
switch (type) {
case TYPE_DIR:
}
switch (type) {
case TYPE_DIR:
- break;
case TYPE_SPECIAL:
case TYPE_SPECIAL:
+ break;
case TYPE_DEVICE:
devp = F_RDEV_P(file);
if (sxp->st.st_rdev != MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp)))
case TYPE_DEVICE:
devp = F_RDEV_P(file);
if (sxp->st.st_rdev != MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp)))
@@
-1611,8
+1613,12
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
|| (preserve_specials && IS_SPECIAL(file->mode))) {
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
|| (preserve_specials && IS_SPECIAL(file->mode))) {
- uint32 *devp = F_RDEV_P(file);
- dev_t rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
+ dev_t rdev;
+ if (IS_DEVICE(file->mode)) {
+ uint32 *devp = F_RDEV_P(file);
+ rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
+ } else
+ rdev = 0;
if (statret == 0) {
int del_for_flag;
if (IS_DEVICE(file->mode)) {
if (statret == 0) {
int del_for_flag;
if (IS_DEVICE(file->mode)) {
@@
-1626,7
+1632,7
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
if (statret == 0
&& BITS_EQUAL(sx.st.st_mode, file->mode, _S_IFMT)
}
if (statret == 0
&& BITS_EQUAL(sx.st.st_mode, file->mode, _S_IFMT)
- &&
sx.st.st_rdev == rdev
) {
+ &&
(IS_SPECIAL(sx.st.st_mode) || sx.st.st_rdev == rdev)
) {
/* The device or special file is identical. */
set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
if (itemizing)
/* The device or special file is identical. */
set_file_attrs(fname, file, &sx, NULL, maybe_ATTRS_REPORT);
if (itemizing)
@@
-2135,10
+2141,9
@@
void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
if (first_flist->in_progress || first_flist->to_redo)
break;
if (first_flist->in_progress || first_flist->to_redo)
break;
- if (!read_batch) {
- write_ndx(sock_f_out, NDX_DONE);
+ write_ndx(sock_f_out, NDX_DONE);
+ if (!read_batch)
maybe_flush_socket(1);
maybe_flush_socket(1);
- }
if (delete_during == 2 || !dir_tweaking) {
/* Skip directory touch-up. */
if (delete_during == 2 || !dir_tweaking) {
/* Skip directory touch-up. */
@@
-2237,10
+2242,6
@@
void generate_files(int f_out, const char *local_name)
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
- /* We must be sure we've had a chance to receive an I/O
- * error for this directory before we delete in it. */
- while (check_for_io_err && !cur_flist->next)
- wait_for_receiver();
delete_in_dir(fbuf, fp, &dirdev);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
delete_in_dir(fbuf, fp, &dirdev);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));