|
@@ -533,9 +533,9 @@ EXPORT_SYMBOL(inet_dgram_connect);
|
|
|
|
|
|
static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias)
|
|
|
{
|
|
|
- DEFINE_WAIT(wait);
|
|
|
+ DEFINE_WAIT_FUNC(wait, woken_wake_function);
|
|
|
|
|
|
- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
|
|
|
+ add_wait_queue(sk_sleep(sk), &wait);
|
|
|
sk->sk_write_pending += writebias;
|
|
|
|
|
|
/* Basic assumption: if someone sets sk->sk_err, he _must_
|
|
@@ -545,13 +545,12 @@ static long inet_wait_for_connect(struct sock *sk, long timeo, int writebias)
|
|
|
*/
|
|
|
while ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
|
|
|
release_sock(sk);
|
|
|
- timeo = schedule_timeout(timeo);
|
|
|
+ timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, timeo);
|
|
|
lock_sock(sk);
|
|
|
if (signal_pending(current) || !timeo)
|
|
|
break;
|
|
|
- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
|
|
|
}
|
|
|
- finish_wait(sk_sleep(sk), &wait);
|
|
|
+ remove_wait_queue(sk_sleep(sk), &wait);
|
|
|
sk->sk_write_pending -= writebias;
|
|
|
return timeo;
|
|
|
}
|