diff options
author | Sjur Braendeland <sjur.brandeland@stericsson.com> | 2010-05-21 04:16:07 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-24 08:57:41 +0200 |
commit | 9e4b816bc31962ebbb8784d602acd5fa25a08ad8 (patch) | |
tree | e4f15177ea142bacda24c6ed8495748e19cb033a /net/caif/caif_socket.c | |
parent | net-2.6 : V2 - fix dev_get_valid_name (diff) | |
download | linux-9e4b816bc31962ebbb8784d602acd5fa25a08ad8.tar.xz linux-9e4b816bc31962ebbb8784d602acd5fa25a08ad8.zip |
caif: Bugfix - wait_ev*_timeout returns long.
Discovered bug when testing on 64bit architecture.
Fixed by using long to store result from wait_event_interruptible_timeout.
Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/caif_socket.c')
-rw-r--r-- | net/caif/caif_socket.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index c3a70c5c893a..77e99568acda 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c @@ -920,17 +920,17 @@ wait_connect: timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); release_sock(sk); - err = wait_event_interruptible_timeout(*sk_sleep(sk), + err = -ERESTARTSYS; + timeo = wait_event_interruptible_timeout(*sk_sleep(sk), sk->sk_state != CAIF_CONNECTING, timeo); lock_sock(sk); - if (err < 0) + if (timeo < 0) goto out; /* -ERESTARTSYS */ - if (err == 0 && sk->sk_state != CAIF_CONNECTED) { - err = -ETIMEDOUT; - goto out; - } + err = -ETIMEDOUT; + if (timeo == 0 && sk->sk_state != CAIF_CONNECTED) + goto out; if (sk->sk_state != CAIF_CONNECTED) { sock->state = SS_UNCONNECTED; err = sock_error(sk); @@ -945,7 +945,6 @@ out: return err; } - /* * caif_release() - Disconnect a CAIF Socket * Copied and modified af_irda.c:irda_release(). |