[git commit] hush: remove superfluous comparison

Denys Vlasenko vda.linux at googlemail.com
Fri Jul 14 17:27:03 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=0c5657e9119eb52263e83e9b55394a8f43f4e928
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
builtin_wait                                         291     285      -6

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/hush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/hush.c b/shell/hush.c
index 553c8e6..af5c260 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9967,7 +9967,7 @@ static int FAST_FUNC builtin_wait(char **argv)
 			/* No */
 			ret = 127;
 			if (errno == ECHILD) {
-				if (G.last_bg_pid > 0 && pid == G.last_bg_pid) {
+				if (pid == G.last_bg_pid) {
 					/* "wait $!" but last bg task has already exited. Try:
 					 * (sleep 1; exit 3) & sleep 2; echo $?; wait $!; echo $?
 					 * In bash it prints exitcode 0, then 3.


More information about the busybox-cvs mailing list