|
@@ -468,7 +468,7 @@ done:
|
|
|
|
|
|
static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags)
|
|
|
{
|
|
|
- DECLARE_WAITQUEUE(wait, current);
|
|
|
+ DEFINE_WAIT_FUNC(wait, woken_wake_function);
|
|
|
struct sock *sk = sock->sk, *nsk;
|
|
|
long timeo;
|
|
|
int err = 0;
|
|
@@ -487,8 +487,6 @@ static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int f
|
|
|
/* Wait for an incoming connection. (wake-one). */
|
|
|
add_wait_queue_exclusive(sk_sleep(sk), &wait);
|
|
|
while (1) {
|
|
|
- set_current_state(TASK_INTERRUPTIBLE);
|
|
|
-
|
|
|
if (sk->sk_state != BT_LISTEN) {
|
|
|
err = -EBADFD;
|
|
|
break;
|
|
@@ -509,10 +507,11 @@ static int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int f
|
|
|
}
|
|
|
|
|
|
release_sock(sk);
|
|
|
- timeo = schedule_timeout(timeo);
|
|
|
+
|
|
|
+ timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, timeo);
|
|
|
+
|
|
|
lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
|
|
|
}
|
|
|
- __set_current_state(TASK_RUNNING);
|
|
|
remove_wait_queue(sk_sleep(sk), &wait);
|
|
|
|
|
|
if (err)
|