aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorVidar Holen <spam@vidarholen.net>2019-03-25 14:44:58 -0700
committerRob Landley <rob@landley.net>2019-03-25 20:59:44 -0500
commit44dd6dd6520430b677ab97e886e8317490f04355 (patch)
tree36cecf467fc6da70e3103b547d67e8a9c720b19e /toys/posix
parent79dc2434cb8d39213b24b89f6c618174d8e9cbd4 (diff)
downloadtoybox-44dd6dd6520430b677ab97e886e8317490f04355.tar.gz
find: fix inverted -exec exit status
The return value of -exec was the command's exit code, which did not account for the fact that an exit code of zero means success, while in C, zero means failure. From POSIX: > the primary shall evaluate as true if the utility returns a zero > value as exit status This commit flips the return value, and adds two tests.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/find.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/find.c b/toys/posix/find.c
index 1c35155b..5cefbf15 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -530,7 +530,7 @@ static int do_find(struct dirtree *new)
aa->plus = 1;
toys.exitval |= flush_exec(new, aa);
}
- } else test = flush_exec(new, aa);
+ } else test = !flush_exec(new, aa);
}
// Argument consumed, skip the check.