From: Alan Cox Date: Fri, 21 Sep 2018 22:41:09 +0000 (+0100) Subject: swap: fix a nasty little bug X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=cf382e5c12b32c18505aae9cc70391ddfa535227;p=FUZIX.git swap: fix a nasty little bug We checked against the wrong process for one case, that in turn meant a specific pattern of activity could mess up when it tried to swap out a zombie process --- diff --git a/Kernel/swap.c b/Kernel/swap.c index c2c269c9..7e19b606 100644 --- a/Kernel/swap.c +++ b/Kernel/swap.c @@ -104,7 +104,7 @@ static ptptr swapvictim(ptptr p, int notself) if (c->p_status == P_READY) r = c; if (c->p_status > P_READY - && p->p_status <= P_FORKING) { + && c->p_status <= P_FORKING) { /* relative position in order of waits, bigger is longer, can wrap but shouldn't really matter to us much if it does */ s = (waitno - c->p_waitno);