summaryrefslogtreecommitdiff
path: root/pkg/zfs/patch/0002-Use-find-exec-rm-instead-of-non-portable-delete.patch
blob: f81214a422825fe91cdf09c2ed8f55a01f70a192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From 4f2a58f0763898a49d2b5d76f92f321947188708 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 17 Jan 2023 12:56:34 -0800
Subject: [PATCH] Use find -exec rm instead of non-portable -delete

---
 config/ax_code_coverage.m4                                    | 2 +-
 module/Makefile.in                                            | 4 ++--
 .../tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh | 2 +-
 .../tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh   | 2 +-
 .../tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib   | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/config/ax_code_coverage.m4 b/config/ax_code_coverage.m4
index cd2498358..83b3dbf30 100644
--- a/config/ax_code_coverage.m4
+++ b/config/ax_code_coverage.m4
@@ -153,7 +153,7 @@ distclean: code-coverage-clean
 code-coverage-clean:
 	-$(LCOV) --directory $(top_builddir) -z
 	-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-	-find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
+	-find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -exec rm -- {} +
 ']
 	], [
 		[CODE_COVERAGE_RULES_CHECK='
diff --git a/module/Makefile.in b/module/Makefile.in
index 9b34b3dfa..63d18d270 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -71,7 +71,7 @@ clean-Linux:
 @CONFIG_KERNEL_TRUE@	$(MAKE) -C @LINUX_OBJ@ M="$$PWD" @KERNEL_MAKE@ clean
 
 	$(RM) @LINUX_SYMBOLS@ Module.markers
-	find . -name '*.ur-safe' -type f -delete
+	find . -name '*.ur-safe' -type f -exec $(RM) -- {} +
 
 clean-FreeBSD:
 	+$(FMAKE) clean
@@ -91,7 +91,7 @@ modules_install-Linux: modules_uninstall-Linux-legacy
 		KERNELRELEASE=@LINUX_VERSION@
 	@# Remove extraneous build products when packaging
 	if [ -n "$(DESTDIR)" ]; then \
-		find $(KMODDIR) -name 'modules.*' -delete; \
+		find $(KMODDIR) -name 'modules.*' -exec $(RM) -- {} + \
 	fi
 	@# Debian ships tiny fake System.map files that are
 	@# syntactically valid but just say
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
index 81ee87f8a..903d2856f 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
@@ -33,7 +33,7 @@ function cleanup
 	for snap in $TESTSNAP1 $TESTSNAP2; do
 		snapexists "$snap" && destroy_dataset "$snap"
 	done
-	find "$MNTPOINT" -type f -delete
+	find "$MNTPOINT" -type f -exec rm -- {} +
 	rm -f "$FILEDIFF"
 }
 
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
index 157603981..cf60d03c5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
@@ -61,7 +61,7 @@ function test_pool
 	object=$(ls -i $mntpnt | awk '{print $1}')
 	log_must zfs snapshot $POOL/fs@a
 	while true; do
-		log_must find $mntpnt/ -type f -delete
+		log_must find $mntpnt/ -type f -exec rm -- {} +
 		sync_all_pools
 		log_must mkfiles "$mntpnt/" 4000
 		sync_all_pools
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
index 93355d0b3..88fc777e1 100644
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
@@ -60,7 +60,7 @@ function udev_cleanup
 
 	udevadm settle
 	# find all dangling links and delete them
-	find -L "${ZVOL_DEVDIR}" -type l -print -delete
+	find -L "${ZVOL_DEVDIR}" -type l -print -exec rm -- {} +
 	# purge those links from udev database
 	udevadm info --cleanup-db
 }
-- 
2.37.3