[SCM] The rsync repository. - branch b3.0.x updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Mon Feb 21 19:45:23 MST 2011


The branch, b3.0.x has been updated
       via  8b7f20b Mention latest changes.
       via  1dabd5d A few more xattr-support fixes from the master branch.
       via  58d657c Be clear on which part(s) of testsuite's checkit() failed.
       via  e46262f Fix issues with unchanged_attrs() for symlinks.
       via  4d92246 Use ftruncate() at the end of a --sparse file. Fixes bug 7337.
       via  8f48ba0 Integrate time-setting fixes/improvements from the master branch.
       via  eb80585 Make case_N.h more generic.
       via  3c624bb Better mask handling, including some changes to help solaris.
       via  24e76f8 Pass "new_mode" to set_acl() and change its return values.
       via  b62ea51 Put file descriptor arg at the start of the arg list for consistency.
      from  a6b3c2b Added more missing NEWS items.

;a=shortlog;h=b3.0.x


- Log -----------------------------------------------------------------
commit 8b7f20b6d35ee7458665c33114919567f5793503
Author: Wayne Davison <wayned at samba.org>
Date:   Mon Feb 21 10:20:29 2011 -0800

    Mention latest changes.

commit 1dabd5dc9a46eb48b8525bf76a78218cf31e9e37
Author: Wayne Davison <wayned at samba.org>
Date:   Mon Feb 21 08:04:31 2011 -0800

    A few more xattr-support fixes from the master branch.

commit 58d657c98f7e49ecdfefd72d525cca570d48de77
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Jan 1 17:28:56 2011 -0800

    Be clear on which part(s) of testsuite's checkit() failed.

commit e46262f36d617c7aa3e3b5615437722930a23e1b
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Dec 18 08:48:07 2010 -0800

    Fix issues with unchanged_attrs() for symlinks.

commit 4d92246a549af10990161e65c60304a5135e7cef
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Nov 6 09:57:23 2010 -0700

    Use ftruncate() at the end of a --sparse file.
    Fixes bug 7337.

commit 8f48ba03b53dfb62c866ecc617a6919fa6b8910d
Author: Wayne Davison <wayned at samba.org>
Date:   Mon Feb 21 09:48:37 2011 -0800

    Integrate time-setting fixes/improvements from the master branch.

commit eb8058577db2c728a8b40a06c3fdb4416b19a843
Author: Wayne Davison <wayned at samba.org>
Date:   Thu Aug 26 10:13:04 2010 -0700

    Make case_N.h more generic.

commit 3c624bba85930590bc349fa7a7076444ba14e9d8
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Sep 12 09:40:31 2009 -0700

    Better mask handling, including some changes to help solaris.

commit 24e76f840e16667944b267636d60537be7235013
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Sep 12 09:27:07 2009 -0700

    Pass "new_mode" to set_acl() and change its return values.

commit b62ea517f6bc11e208f55f6b08193499d18e5926
Author: Wayne Davison <wayned at samba.org>
Date:   Sat Sep 12 09:13:38 2009 -0700

    Put file descriptor arg at the start of the arg list for consistency.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                |   15 ++++++-
 acls.c              |  120 ++++++++++++++++++++++++++------------------------
 case_N.h            |   79 ++++++++++++++++-----------------
 cleanup.c           |   13 ++++-
 compat.c            |    6 +-
 configure.ac        |    3 +-
 fileio.c            |   28 +++++++-----
 flist.c             |   13 +++---
 generator.c         |  108 ++++++++++++++++++++++++++++++++++------------
 options.c           |   23 ++++++----
 receiver.c          |    5 +-
 rsync.c             |   12 +++--
 rsync.h             |   16 +++++++
 syscall.c           |   90 ++++++++++++++++++++++++++++++++++++++
 t_stub.c            |    1 +
 testsuite/rsync.fns |   11 +++--
 util.c              |   73 ++++++++++++++++++-------------
 xattrs.c            |   31 +++++++++++---
 18 files changed, 435 insertions(+), 212 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS b/NEWS
index 2d57124..17429d4 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Changes since 3.0.7:
       being too big and skip it.
 
     - For devices and special files, we now avoid gathering useless ACL and/or
-      xattr information for files that aren't being copied.  (The uncopied
+      xattr information for files that aren't being copied.  (The un-copied
       files are still put into the file list, but there's no need to gather
       data that is not going to be used.)  This ensures that if the user uses
       --no-D, that rsync can't possibly complain about being unable to gather
@@ -41,6 +41,11 @@ Changes since 3.0.7:
     - If the destination arg is an empty string, it will be treated as a
       reference to the current directory (as 2.x used to do).
 
+    - If rsync was compiled with a newer time-setting function (such as
+      lutimes), rsync will fall-back to an older function (such as utimes) on a
+      system where the newer function is not around.  This helps to make the
+      rsync binary more portable in mixed-OS-release situations.
+
     - Fixed a batch-file writing bug that would not write out the full set of
       compatibility flags that the transfer was using.  This fixes a potential
       protocol problem for a batch file that contains a sender-side I/O error:
@@ -57,6 +62,8 @@ Changes since 3.0.7:
     - If we fail to connect to an rsync daemon, report all the connection
       errors (e.g. IPv4 & IPv6), not just the last one.
 
+    - Improved ACL mask handling, e.g. for Solaris.
+
     - Fixed an issue where an xattr and/or ACL transfer that used an alt-dest
       option (e.g. --link-dest) could output an error trying to itemize the
       changes against the alt-dest directory's xattr/ACL info but was instead
@@ -65,6 +72,9 @@ Changes since 3.0.7:
     - Improved xattr system-error messages to mention the full path to the
       file.
 
+    - The --link-dest checking for identical symlinks now avoids considering
+      attribute differences that cannot be changed on the receiver.
+
     - Avoid trying to read/write xattrs on certain file types for certain OSes.
       Improved configure to set NO_SYMLINK_XATTRS, NO_DEVICE_XATTRS, and/or
       NO_SPECIAL_XATTRS defines in config.h.
@@ -76,6 +86,9 @@ Changes since 3.0.7:
     - Fixed a bug with --fake-super when copying files and dirs that aren't
       user writable.
 
+    - Fixed a bug where a sparse file could have its last sparse block turned
+      into a real block when rsync sets the file size (requires ftruncate).
+
     - If a temp-file name is too long, rsync now avoids truncating the name in
       the middle of adjacent high-bit characters.  This prevents a potential
       filename error if the filesystem doesn't allow a name to contain an
diff --git a/acls.c b/acls.c
index 27a93c0..87b6c80 100644
--- a/acls.c
+++ b/acls.c
@@ -117,10 +117,11 @@ static int calc_sacl_entries(const rsync_acl *racl)
 	/* A System ACL always gets user/group/other permission entries. */
 	return racl->names.count
 #ifdef ACLS_NEED_MASK
-	     + 4;
+	     + 1
 #else
-	     + (racl->mask_obj != NO_ENTRY) + 3;
+	     + (racl->mask_obj != NO_ENTRY)
 #endif
+	     + 3;
 }
 
 /* Extracts and returns the permission bits from the ACL.  This cannot be
@@ -134,16 +135,21 @@ static int rsync_acl_get_perms(const rsync_acl *racl)
 
 /* Removes the permission-bit entries from the ACL because these
  * can be reconstructed from the file's mode. */
-static void rsync_acl_strip_perms(rsync_acl *racl)
+static void rsync_acl_strip_perms(stat_x *sxp)
 {
+	rsync_acl *racl = sxp->acc_acl;
+
 	racl->user_obj = NO_ENTRY;
 	if (racl->mask_obj == NO_ENTRY)
 		racl->group_obj = NO_ENTRY;
 	else {
-		if (racl->group_obj == racl->mask_obj)
+		int group_perms = (sxp->st.st_mode >> 3) & 7;
+		if (racl->group_obj == group_perms)
 			racl->group_obj = NO_ENTRY;
-		if (racl->names.count != 0)
+#ifndef HAVE_SOLARIS_ACLS
+		if (racl->names.count != 0 && racl->mask_obj == group_perms)
 			racl->mask_obj = NO_ENTRY;
+#endif
 	}
 	racl->other_obj = NO_ENTRY;
 }
@@ -342,15 +348,6 @@ static BOOL unpack_smb_acl(SMB_ACL_T sacl, rsync_acl *racl)
 	/* Truncate the temporary list now that its idas have been saved. */
 	temp_ida_list.count = 0;
 
-#ifdef ACLS_NEED_MASK
-	if (!racl->names.count && racl->mask_obj != NO_ENTRY) {
-		/* Throw away a superfluous mask, but mask off the
-		 * group perms with it first. */
-		racl->group_obj &= racl->mask_obj;
-		racl->mask_obj = NO_ENTRY;
-	}
-#endif
-
 	return True;
 }
 
@@ -580,7 +577,7 @@ int get_acl(const char *fname, stat_x *sxp)
 /* === Send functions === */
 
 /* Send the ida list over the file descriptor. */
-static void send_ida_entries(const ida_entries *idal, int f)
+static void send_ida_entries(int f, const ida_entries *idal)
 {
 	id_access *ida;
 	size_t count = idal->count;
@@ -606,8 +603,8 @@ static void send_ida_entries(const ida_entries *idal, int f)
 	}
 }
 
-static void send_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type,
-			   item_list *racl_list, int f)
+static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type,
+			   item_list *racl_list)
 {
 	int ndx = find_matching_rsync_acl(racl, type, racl_list);
 
@@ -640,7 +637,7 @@ static void send_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type,
 		if (flags & XMIT_OTHER_OBJ)
 			write_varint(f, racl->other_obj);
 		if (flags & XMIT_NAME_LIST)
-			send_ida_entries(&racl->names, f);
+			send_ida_entries(f, &racl->names);
 
 		/* Give the allocated data to the new list object. */
 		*new_racl = *racl;
@@ -650,28 +647,28 @@ static void send_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type,
 
 /* Send the ACL from the stat_x structure down the indicated file descriptor.
  * This also frees the ACL data. */
-void send_acl(stat_x *sxp, int f)
+void send_acl(int f, stat_x *sxp)
 {
 	if (!sxp->acc_acl) {
 		sxp->acc_acl = create_racl();
 		rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode);
 	}
 	/* Avoid sending values that can be inferred from other data. */
-	rsync_acl_strip_perms(sxp->acc_acl);
+	rsync_acl_strip_perms(sxp);
 
-	send_rsync_acl(sxp->acc_acl, SMB_ACL_TYPE_ACCESS, &access_acl_list, f);
+	send_rsync_acl(f, sxp->acc_acl, SMB_ACL_TYPE_ACCESS, &access_acl_list);
 
 	if (S_ISDIR(sxp->st.st_mode)) {
 		if (!sxp->def_acl)
 			sxp->def_acl = create_racl();
 
-		send_rsync_acl(sxp->def_acl, SMB_ACL_TYPE_DEFAULT, &default_acl_list, f);
+		send_rsync_acl(f, sxp->def_acl, SMB_ACL_TYPE_DEFAULT, &default_acl_list);
 	}
 }
 
 /* === Receive functions === */
 
-static uint32 recv_acl_access(uchar *name_follows_ptr, int f)
+static uint32 recv_acl_access(int f, uchar *name_follows_ptr)
 {
 	uint32 access = read_varint(f);
 
@@ -696,7 +693,7 @@ static uint32 recv_acl_access(uchar *name_follows_ptr, int f)
 	return access;
 }
 
-static uchar recv_ida_entries(ida_entries *ent, int f)
+static uchar recv_ida_entries(int f, ida_entries *ent)
 {
 	uchar computed_mask_bits = 0;
 	int i, count = read_varint(f);
@@ -712,7 +709,7 @@ static uchar recv_ida_entries(ida_entries *ent, int f)
 	for (i = 0; i < count; i++) {
 		uchar has_name;
 		id_t id = read_varint(f);
-		uint32 access = recv_acl_access(&has_name, f);
+		uint32 access = recv_acl_access(f, &has_name);
 
 		if (has_name) {
 			if (access & NAME_IS_USER)
@@ -735,7 +732,7 @@ static uchar recv_ida_entries(ida_entries *ent, int f)
 	return computed_mask_bits & ~NO_ENTRY;
 }
 
-static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f)
+static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode_t mode)
 {
 	uchar computed_mask_bits = 0;
 	acl_duo *duo_item;
@@ -750,7 +747,7 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f)
 
 	if (ndx != 0)
 		return ndx - 1;
-	
+
 	ndx = racl_list->count;
 	duo_item = EXPAND_ITEM_LIST(racl_list, acl_duo, 1000);
 	duo_item->racl = empty_rsync_acl;
@@ -758,22 +755,28 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f)
 	flags = read_byte(f);
 
 	if (flags & XMIT_USER_OBJ)
-		duo_item->racl.user_obj = recv_acl_access(NULL, f);
+		duo_item->racl.user_obj = recv_acl_access(f, NULL);
 	if (flags & XMIT_GROUP_OBJ)
-		duo_item->racl.group_obj = recv_acl_access(NULL, f);
+		duo_item->racl.group_obj = recv_acl_access(f, NULL);
 	if (flags & XMIT_MASK_OBJ)
-		duo_item->racl.mask_obj = recv_acl_access(NULL, f);
+		duo_item->racl.mask_obj = recv_acl_access(f, NULL);
 	if (flags & XMIT_OTHER_OBJ)
-		duo_item->racl.other_obj = recv_acl_access(NULL, f);
+		duo_item->racl.other_obj = recv_acl_access(f, NULL);
 	if (flags & XMIT_NAME_LIST)
-		computed_mask_bits |= recv_ida_entries(&duo_item->racl.names, f);
+		computed_mask_bits |= recv_ida_entries(f, &duo_item->racl.names);
 
 #ifdef HAVE_OSX_ACLS
 	/* If we received a superfluous mask, throw it away. */
 	duo_item->racl.mask_obj = NO_ENTRY;
 #else
-	if (duo_item->racl.names.count && duo_item->racl.mask_obj == NO_ENTRY) /* Must be non-empty with lists. */
-		duo_item->racl.mask_obj = (computed_mask_bits | duo_item->racl.group_obj) & ~NO_ENTRY;
+	if (duo_item->racl.names.count && duo_item->racl.mask_obj == NO_ENTRY) {
+		/* Mask must be non-empty with lists. */
+		if (type == SMB_ACL_TYPE_ACCESS)
+			computed_mask_bits = (mode >> 3) & 7;
+		else
+			computed_mask_bits |= duo_item->racl.group_obj & ~NO_ENTRY;
+		duo_item->racl.mask_obj = computed_mask_bits;
+	}
 #endif
 
 	duo_item->sacl = NULL;
@@ -782,12 +785,12 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f)
 }
 
 /* Receive the ACL info the sender has included for this file-list entry. */
-void receive_acl(struct file_struct *file, int f)
+void receive_acl(int f, struct file_struct *file)
 {
-	F_ACL(file) = recv_rsync_acl(&access_acl_list, SMB_ACL_TYPE_ACCESS, f);
+	F_ACL(file) = recv_rsync_acl(f, &access_acl_list, SMB_ACL_TYPE_ACCESS, file->mode);
 
 	if (S_ISDIR(file->mode))
-		F_DIR_DEFACL(file) = recv_rsync_acl(&default_acl_list, SMB_ACL_TYPE_DEFAULT, f);
+		F_DIR_DEFACL(file) = recv_rsync_acl(f, &default_acl_list, SMB_ACL_TYPE_DEFAULT, 0);
 }
 
 static int cache_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type, item_list *racl_list)
@@ -899,12 +902,14 @@ static mode_t change_sacl_perms(SMB_ACL_T sacl, rsync_acl *racl, mode_t old_mode
 			COE2( store_access_in_entry,((mode >> 3) & 7, entry) );
 			break;
 		case SMB_ACL_MASK:
+#ifndef HAVE_SOLARIS_ACLS
 #ifndef ACLS_NEED_MASK
 			/* mask is only empty when we don't need it. */
 			if (racl->mask_obj == NO_ENTRY)
 				break;
 #endif
 			COE2( store_access_in_entry,((mode >> 3) & 7, entry) );
+#endif
 			break;
 		case SMB_ACL_OTHER:
 			COE2( store_access_in_entry,(mode & 7, entry) );
@@ -917,7 +922,7 @@ static mode_t change_sacl_perms(SMB_ACL_T sacl, rsync_acl *racl, mode_t old_mode
 			rsyserr(FERROR_XFER, errno, "change_sacl_perms: %s()",
 				errfun);
 		}
-		return (mode_t)~0;
+		return (mode_t)-1;
 	}
 
 #ifdef SMB_ACL_LOSES_SPECIAL_MODE_BITS
@@ -986,7 +991,7 @@ static int set_rsync_acl(const char *fname, acl_duo *duo_item,
 		if (type == SMB_ACL_TYPE_ACCESS) {
 			cur_mode = change_sacl_perms(duo_item->sacl, &duo_item->racl,
 						     cur_mode, mode);
-			if (cur_mode == (mode_t)~0)
+			if (cur_mode == (mode_t)-1)
 				return 0;
 		}
 #endif
@@ -1002,17 +1007,17 @@ static int set_rsync_acl(const char *fname, acl_duo *duo_item,
 	return 0;
 }
 
-/* Set ACL on indicated filename.
+/* Given a fname, this sets extended access ACL entries, the default ACL (for a
+ * dir), and the regular mode bits on the file.  Call this with fname set to
+ * NULL to just check if the ACL is different.
  *
- * This sets extended access ACL entries and default ACL.  If convenient,
- * it sets permission bits along with the access ACL and signals having
- * done so by modifying sxp->st.st_mode.
+ * If the ACL operation has a side-effect of changing the file's mode, the
+ * sxp->st.st_mode value will be changed to match.
  *
- * Returns 1 for unchanged, 0 for changed, -1 for failed.  Call this
- * with fname set to NULL to just check if the ACL is unchanged. */
-int set_acl(const char *fname, const struct file_struct *file, stat_x *sxp)
+ * Returns 0 for an unchanged ACL, 1 for changed, -1 for failed. */
+int set_acl(const char *fname, const struct file_struct *file, stat_x *sxp, mode_t new_mode)
 {
-	int unchanged = 1;
+	int changed = 0;
 	int32 ndx;
 	BOOL eq;
 
@@ -1026,18 +1031,18 @@ int set_acl(const char *fname, const struct file_struct *file, stat_x *sxp)
 		acl_duo *duo_item = access_acl_list.items;
 		duo_item += ndx;
 		eq = sxp->acc_acl
-		  && rsync_acl_equal_enough(sxp->acc_acl, &duo_item->racl, file->mode);
+		  && rsync_acl_equal_enough(sxp->acc_acl, &duo_item->racl, new_mode);
 		if (!eq) {
-			unchanged = 0;
+			changed = 1;
 			if (!dry_run && fname
 			 && set_rsync_acl(fname, duo_item, SMB_ACL_TYPE_ACCESS,
-					  sxp, file->mode) < 0)
-				unchanged = -1;
+					  sxp, new_mode) < 0)
+				return -1;
 		}
 	}
 
-	if (!S_ISDIR(sxp->st.st_mode))
-		return unchanged;
+	if (!S_ISDIR(new_mode))
+		return changed;
 
 	ndx = F_DIR_DEFACL(file);
 	if (ndx >= 0 && (size_t)ndx < default_acl_list.count) {
@@ -1045,16 +1050,15 @@ int set_acl(const char *fname, const struct file_struct *file, stat_x *sxp)
 		duo_item += ndx;
 		eq = sxp->def_acl && rsync_acl_equal(sxp->def_acl, &duo_item->racl);
 		if (!eq) {
-			if (unchanged > 0)
-				unchanged = 0;
+			changed = 1;
 			if (!dry_run && fname
 			 && set_rsync_acl(fname, duo_item, SMB_ACL_TYPE_DEFAULT,
-					  sxp, file->mode) < 0)
-				unchanged = -1;
+					  sxp, new_mode) < 0)
+				return -1;
 		}
 	}
 
-	return unchanged;
+	return changed;
 }
 
 /* Non-incremental recursion needs to convert all the received IDs.
diff --git a/case_N.h b/case_N.h
index eb31663..52bd4ec 100644
--- a/case_N.h
+++ b/case_N.h
@@ -1,7 +1,7 @@
 /*
- * End-of-run cleanup helper code used by cleanup.c.
+ * Allow an arbitrary sequence of case labels.
  *
- * Copyright (C) 2006-2008 Wayne Davison
+ * Copyright (C) 2006-2010 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
@@ -17,63 +17,60 @@
  * with this program; if not, visit the http://fsf.org website.
  */
 
-/* This is included by cleanup.c multiple times, once for every segement in
- * the _exit_cleanup() code.  This produces the next "case N:" statement in
- * sequence and increments the cleanup_step variable by 1.  This ensures that
- * our case statements never get out of whack due to added/removed steps. */
+/* This is included multiple times, once for every segement in a switch statement.
+ * This produces the next "case N:" statement in sequence. */
 
-#if !defined EXIT_CLEANUP_CASE_0
-#define EXIT_CLEANUP_CASE_0
+#if !defined CASE_N_STATE_0
+#define CASE_N_STATE_0
 	case 0:
-#elif !defined EXIT_CLEANUP_CASE_1
-#define EXIT_CLEANUP_CASE_1
+#elif !defined CASE_N_STATE_1
+#define CASE_N_STATE_1
 	case 1:
-#elif !defined EXIT_CLEANUP_CASE_2
-#define EXIT_CLEANUP_CASE_2
+#elif !defined CASE_N_STATE_2
+#define CASE_N_STATE_2
 	case 2:
-#elif !defined EXIT_CLEANUP_CASE_3
-#define EXIT_CLEANUP_CASE_3
+#elif !defined CASE_N_STATE_3
+#define CASE_N_STATE_3
 	case 3:
-#elif !defined EXIT_CLEANUP_CASE_4
-#define EXIT_CLEANUP_CASE_4
+#elif !defined CASE_N_STATE_4
+#define CASE_N_STATE_4
 	case 4:
-#elif !defined EXIT_CLEANUP_CASE_5
-#define EXIT_CLEANUP_CASE_5
+#elif !defined CASE_N_STATE_5
+#define CASE_N_STATE_5
 	case 5:
-#elif !defined EXIT_CLEANUP_CASE_6
-#define EXIT_CLEANUP_CASE_6
+#elif !defined CASE_N_STATE_6
+#define CASE_N_STATE_6
 	case 6:
-#elif !defined EXIT_CLEANUP_CASE_7
-#define EXIT_CLEANUP_CASE_7
+#elif !defined CASE_N_STATE_7
+#define CASE_N_STATE_7
 	case 7:
-#elif !defined EXIT_CLEANUP_CASE_8
-#define EXIT_CLEANUP_CASE_8
+#elif !defined CASE_N_STATE_8
+#define CASE_N_STATE_8
 	case 8:
-#elif !defined EXIT_CLEANUP_CASE_9
-#define EXIT_CLEANUP_CASE_9
+#elif !defined CASE_N_STATE_9
+#define CASE_N_STATE_9
 	case 9:
-#elif !defined EXIT_CLEANUP_CASE_10
-#define EXIT_CLEANUP_CASE_10
+#elif !defined CASE_N_STATE_10
+#define CASE_N_STATE_10
 	case 10:
-#elif !defined EXIT_CLEANUP_CASE_11
-#define EXIT_CLEANUP_CASE_11
+#elif !defined CASE_N_STATE_11
+#define CASE_N_STATE_11
 	case 11:
-#elif !defined EXIT_CLEANUP_CASE_12
-#define EXIT_CLEANUP_CASE_12
+#elif !defined CASE_N_STATE_12
+#define CASE_N_STATE_12
 	case 12:
-#elif !defined EXIT_CLEANUP_CASE_13
-#define EXIT_CLEANUP_CASE_13
+#elif !defined CASE_N_STATE_13
+#define CASE_N_STATE_13
 	case 13:
-#elif !defined EXIT_CLEANUP_CASE_14
-#define EXIT_CLEANUP_CASE_14
+#elif !defined CASE_N_STATE_14
+#define CASE_N_STATE_14
 	case 14:
-#elif !defined EXIT_CLEANUP_CASE_15
-#define EXIT_CLEANUP_CASE_15
+#elif !defined CASE_N_STATE_15
+#define CASE_N_STATE_15
 	case 15:
-#elif !defined EXIT_CLEANUP_CASE_16
-#define EXIT_CLEANUP_CASE_16
+#elif !defined CASE_N_STATE_16
+#define CASE_N_STATE_16
 	case 16:
 #else
 #error Need to add more case statements!
 #endif
-		cleanup_step++;
diff --git a/cleanup.c b/cleanup.c
index 9a0bdd7..9382215 100644
--- a/cleanup.c
+++ b/cleanup.c
@@ -94,7 +94,7 @@ pid_t cleanup_child_pid = -1;
  **/
 NORETURN void _exit_cleanup(int code, const char *file, int line)
 {
-	static int cleanup_step = 0;
+	static int switch_step = 0;
 	static int exit_code = 0, exit_line = 0;
 	static const char *exit_file = NULL;
 	static int unmodified_code = 0;
@@ -115,8 +115,9 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
 
 	/* Some of our actions might cause a recursive call back here, so we
 	 * keep track of where we are in the cleanup and never repeat a step. */


-- 
The rsync repository.


More information about the rsync-cvs mailing list