Re: compat_linux: Fix counting in futex_wake.

2012-06-19 Thread Jasper Lievisse Adriaanse
On Tue, Jun 19, 2012 at 12:13:09PM +0300, Paul Irofti wrote:
> Count should always be zero no matter if we need to relocate or not.
> 
> Okay?
Makes sense to me (including the other diffs you sent which I didn't reply to 
individually).

> Index: linux_futex.c
> ===
> RCS file: /cvs/src/sys/compat/linux/linux_futex.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 linux_futex.c
> --- linux_futex.c 19 Jun 2012 08:50:59 -  1.4
> +++ linux_futex.c 19 Jun 2012 09:10:20 -
> @@ -496,12 +496,10 @@ int
>  futex_wake(struct futex *f, int n, struct futex *newf, int n2)
>  {
>   struct waiting_proc *wp;
> - int count;
> + int count = 0;
>  
>   KASSERT(newf != f);
>   MUTEX_ASSERT_LOCKED(&futex_lock);
> -
> - count = newf ? 0 : 1;
>  
>   /*
>* first, wake up any threads sleeping on this futex.
> 

-- 
Cheers,
Jasper

"Stay Hungry. Stay Foolish"



compat_linux: Fix counting in futex_wake.

2012-06-19 Thread Paul Irofti
Count should always be zero no matter if we need to relocate or not.

Okay?

Index: linux_futex.c
===
RCS file: /cvs/src/sys/compat/linux/linux_futex.c,v
retrieving revision 1.4
diff -u -p -r1.4 linux_futex.c
--- linux_futex.c   19 Jun 2012 08:50:59 -  1.4
+++ linux_futex.c   19 Jun 2012 09:10:20 -
@@ -496,12 +496,10 @@ int
 futex_wake(struct futex *f, int n, struct futex *newf, int n2)
 {
struct waiting_proc *wp;
-   int count;
+   int count = 0;
 
KASSERT(newf != f);
MUTEX_ASSERT_LOCKED(&futex_lock);
-
-   count = newf ? 0 : 1;
 
/*
 * first, wake up any threads sleeping on this futex.