find: Return normal exit status from -quit.

If there was an error, make the exit status reflect this even if -quit
caused the exit. Formerly, -quit always caused exit(0).

GNU find does the same.
This commit is contained in:
Jilles Tjoelker 2014-04-13 11:47:17 +00:00
parent e1c6a283f3
commit b547523eb4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=264411
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@
.\" @(#)find.1 8.7 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
.Dd April 12, 2014
.Dd April 13, 2014
.Dt FIND 1
.Os
.Sh NAME
@ -778,7 +778,7 @@ option was specified.
.It Ic -quit
Causes
.Nm
to immediately terminate successfully.
to terminate immediately.
.It Ic -regex Ar pattern
True if the whole path of the file matches
.Ar pattern

View File

@ -1781,7 +1781,7 @@ int
f_quit(PLAN *plan __unused, FTSENT *entry __unused)
{
finish_execplus();
exit(0);
exit(exitstatus);
}
/* c_quit == c_simple */