diff options
author | jilles <jilles@FreeBSD.org> | 2014-04-13 11:47:17 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-04-13 11:47:17 +0000 |
commit | a8ebc1e337eb8e012df0e7a198e07938b93cd23b (patch) | |
tree | a08a60580c3bb76bb7ce6a5ae8cb0ab24b825a0c /usr.bin/find | |
parent | c515b6b1f7b667dabd4949338a7e83ce390fbcb5 (diff) | |
download | FreeBSD-src-a8ebc1e337eb8e012df0e7a198e07938b93cd23b.zip FreeBSD-src-a8ebc1e337eb8e012df0e7a198e07938b93cd23b.tar.gz |
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.
Diffstat (limited to 'usr.bin/find')
-rw-r--r-- | usr.bin/find/find.1 | 4 | ||||
-rw-r--r-- | usr.bin/find/function.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index db808b1..0eb3bf5 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -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 diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 0139406..045b430 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -1781,7 +1781,7 @@ int f_quit(PLAN *plan __unused, FTSENT *entry __unused) { finish_execplus(); - exit(0); + exit(exitstatus); } /* c_quit == c_simple */ |