summaryrefslogtreecommitdiff
authorFelix Fietkau <nbd@openwrt.org>2015-04-09 08:20:16 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2015-04-14 14:45:23 (GMT)
commitf7466e477691fd29f47ebe8ae27489e065c69e5e (patch)
tree232d7640c3945c1b9efe3cdbf9583f4a47fb7875
parenta90490fb69f78148beacf371b603c16276137879 (diff)
downloadbusybox-f7466e477691fd29f47ebe8ae27489e065c69e5e.zip
busybox-f7466e477691fd29f47ebe8ae27489e065c69e5e.tar.gz
busybox-f7466e477691fd29f47ebe8ae27489e065c69e5e.tar.bz2
find: fix regression in status processing for path arguments
Regression added in commit 14158b4127dba30466c50147b868a6a89702960b "find: add optional support for '-exec ... {} +'" This commit causes find to exit on the first path argument that was not found, which breaks existing scripts and is incompatible to other implementations. Instead of exiting on the first failure, return EXIT_FAILURE at the end if any error occurred. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat
-rw-r--r--findutils/find.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/findutils/find.c b/findutils/find.c
index 83aa63f..ced8922 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -1460,12 +1460,10 @@ int find_main(int argc UNUSED_PARAM, char **argv)
NULL, /* user data */
0) /* depth */
) {
- status = EXIT_FAILURE;
- goto out;
+ status |= EXIT_FAILURE;
}
}
- IF_FEATURE_FIND_EXEC_PLUS(status = flush_exec_plus();)
-out:
+ IF_FEATURE_FIND_EXEC_PLUS(status |= flush_exec_plus();)
return status;
}