find: fix regression in status processing for path arguments
Regression added in commit 14158b4127
"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>
This commit is contained in:
parent
a90490fb69
commit
f7466e4776
@ -1460,12 +1460,10 @@ int find_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
NULL, /* user data */
|
NULL, /* user data */
|
||||||
0) /* depth */
|
0) /* depth */
|
||||||
) {
|
) {
|
||||||
status = EXIT_FAILURE;
|
status |= EXIT_FAILURE;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IF_FEATURE_FIND_EXEC_PLUS(status = flush_exec_plus();)
|
IF_FEATURE_FIND_EXEC_PLUS(status |= flush_exec_plus();)
|
||||||
out:
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user