[PATCH] Fix the counting of device files and symlinks

Marc Aurèle La France via rsync <[email protected]> Tue, 16 May 2023 20:15:53 -0600 (MDT)
Newsgroups gmane.network.rsync.general
Message-ID <[email protected]>
Device files should be counted as devices, not symlinks.

Marc.

diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/delete.c devel-3.2.7/delete.c
--- rsync-3.2.7/delete.c	2020-06-13 20:15:02.000000000 -0600
+++ devel-3.2.7/delete.c	2020-06-13 20:15:02.000000000 -0600
@@ -188,7 +188,7 @@ enum delret delete_item(char *fbuf, uint16 mode, uint16 flags)
 				stats.deleted_symlinks++;
 #endif
 			else if (IS_DEVICE(mode))
-				stats.deleted_symlinks++;
+				stats.deleted_devices++;
 			else
 				stats.deleted_specials++;
 		}
diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/flist.c devel-3.2.7/flist.c
--- rsync-3.2.7/flist.c	2022-10-02 10:54:54.000000000 -0600
+++ devel-3.2.7/flist.c	2022-10-02 10:54:54.000000000 -0600
@@ -2659,7 +2659,7 @@ struct file_list *recv_file_list(int f, int dir_ndx)
 		} else if (S_ISLNK(file->mode))
 			stats.num_symlinks++;
 		else if (IS_DEVICE(file->mode))
-			stats.num_symlinks++;
+			stats.num_devices++;
 		else
 			stats.num_specials++;


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html