Commit c850ae1c authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Adrian Bunk

[Bluetooth] Return EINPROGRESS for non-blocking socket calls

In case of non-blocking socket calls we should return EINPROGRESS
and not EAGAIN.
Signed-off-by: default avatarUlisses Furquim <ulissesf@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 1189f487
...@@ -274,7 +274,7 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo) ...@@ -274,7 +274,7 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (!timeo) { if (!timeo) {
err = -EAGAIN; err = -EINPROGRESS;
break; break;
} }
......
...@@ -640,7 +640,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst ...@@ -640,7 +640,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
addr.l2_family = AF_BLUETOOTH; addr.l2_family = AF_BLUETOOTH;
addr.l2_psm = htobs(RFCOMM_PSM); addr.l2_psm = htobs(RFCOMM_PSM);
*err = sock->ops->connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK); *err = sock->ops->connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK);
if (*err == 0 || *err == -EAGAIN) if (*err == 0 || *err == -EINPROGRESS)
return s; return s;
rfcomm_session_del(s); rfcomm_session_del(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment