find: Correctly propagate -exec/-execdir ... {} + exit status.
authorjilles <jilles@FreeBSD.org>
Sat, 12 Apr 2014 22:36:26 +0000 (22:36 +0000)
committerjilles <jilles@FreeBSD.org>
Sat, 12 Apr 2014 22:36:26 +0000 (22:36 +0000)
commit592a703b9051d1f4115fe12011124e936b7b0615
treeb025d3252093a31ed23ae4720ab00cb625bfa5dc
parent48a57d92232eabf3745638fd2614a39c47e0260e
find: Correctly propagate -exec/-execdir ... {} + exit status.

As per POSIX, the -exec ... {} + primary always returns true, but a non-zero
exit status causes find to return a non-zero exit status itself. GNU does
the same, and also for -execdir ... {} +.

It does not make much sense to return false from the primary only when the
child process happens to be run.

The behaviour for -exec/-execdir ... ; remains unchanged: the primary
returns true or false depending on the exit status, and find's exit status
is unaffected.
usr.bin/find/extern.h
usr.bin/find/find.1
usr.bin/find/find.c
usr.bin/find/function.c
usr.bin/find/main.c