Subject: Re: CVS commit: src/sys/kern
To: Mindaugas R. <rmind@NetBSD.org>
From: Matt Thomas <matt@3am-software.com>
List: source-changes
Date: 07/30/2007 19:52:50
Mindaugas R. wrote:
> Hello,
> 
>> Module Name:	src
>> Committed By:	tnn
>> Date:		Tue Jul 31 00:52:05 UTC 2007
>>
>> Modified Files:
>> 	src/sys/kern: kern_lwp.c
>>
>> Log Message:
>> proc_representative_lwp:
>>  - Correct expression for checking if the lwp is running.
>>  - Remove dead code. Ok'd by Andrew Doran.
> 
> -			*nrlwps = (l->l_stat == LSONPROC || LSRUN);
> +			*nrlwps = (l->l_stat & (LSONPROC | LSRUN)) ? 1 : 0;
> 
> LWP status values are not flags - this is not correct. I think it should be:
> 	*nrlwps = (l->l_stat == LSONPROC || l->l_stat == LSRUN) ? 1 : 0;

	*nrlwps = (l->l_stat == LSONPROC || l->l_stat == LSRUN);

should seem to be the most correct.