From 5efc48befd6a8648e978e814e8d9cc080531aa94 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 20 Feb 2015 12:43:22 +0000 Subject: [PATCH] optimise a bit (nuke one redundant check), from igli via IRC --- jobs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jobs.c b/jobs.c index d09adb6..9f517a3 100644 --- a/jobs.c +++ b/jobs.c @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.106 2014/11/25 21:13:27 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.107 2015/02/20 12:43:22 tg Exp $"); #if HAVE_KILLPG #define mksh_killpg killpg @@ -1274,11 +1274,10 @@ j_waitj(Job *j, Proc *p = j->proc_list; int i; - while (p != NULL) { + do { if ((i = proc_errorlevel(p))) rv = i; - p = p->next; - } + } while ((p = p->next) != NULL); } if (!(flags & JW_ASYNCNOTIFY)