public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ulisses Furquim" <ulissesf@gmail.com>
To: "BlueZ development" <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] socket connect returns EAGAIN
Date: Fri, 22 Sep 2006 14:47:07 -0300	[thread overview]
Message-ID: <d23110170609221047m4e0986fdt5c73b898eb84429f@mail.gmail.com> (raw)
In-Reply-To: <1158869153.11194.60.camel@localhost>

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

On 9/21/06, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Ulisses,
>
> > > what about the server socket. In this case EAGAIN is fine.
> >
> > Yes, in this case EAGAIN is fine. However, I don't think we are even
> > calling bt_sock_wait_state() for a server socket (please, correct me
> > if I'm wrong) so changing EAGAIN to EINPROGRESS inside
> > bt_sock_wait_state() should just work, right? (we just  need to fix
> > rfcomm_session_create() too and that's it).
>
> looks like it is okay, care to send a patch.

Here is the patch. I'm running 2.6.18-mh1 plus the attached patch and
I have no problems so far (but it needs more testing so we can be sure
everything works).

Regards,

-- Ulisses

[-- Attachment #2: eagain-to-einprogress.patch --]
[-- Type: text/x-patch, Size: 862 bytes --]

diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 788ea7a..305a099 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -276,7 +276,7 @@ int bt_sock_wait_state(struct sock *sk, 
 		set_current_state(TASK_INTERRUPTIBLE);
 
 		if (!timeo) {
-			err = -EAGAIN;
+			err = -EINPROGRESS;
 			break;
 		}
 
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 332dd8f..468df3b 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -644,7 +644,7 @@ static struct rfcomm_session *rfcomm_ses
 	addr.l2_family = AF_BLUETOOTH;
 	addr.l2_psm    = htobs(RFCOMM_PSM);
 	*err = sock->ops->connect(sock, (struct sockaddr *) &addr, sizeof(addr), O_NONBLOCK);
-	if (*err == 0 || *err == -EAGAIN)
+	if (*err == 0 || *err == -EINPROGRESS)
 		return s;
 
 	rfcomm_session_del(s);

[-- Attachment #3: Type: text/plain, Size: 348 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

      reply	other threads:[~2006-09-22 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12  0:47 [Bluez-devel] socket connect returns EAGAIN Jose Vasconcellos
2006-09-12  8:40 ` Peter Wippich
2006-09-12  8:43   ` Marcel Holtmann
2006-09-12 10:13     ` Peter Wippich
2006-09-12 10:29       ` Marcel Holtmann
2006-09-13 14:21       ` Jose Vasconcellos
2006-09-14  9:01         ` Peter Wippich
2006-09-15  9:49           ` Marcel Holtmann
2006-09-20 14:48             ` Ulisses Furquim
2006-09-20 15:00               ` Peter Wippich
2006-09-20 15:05               ` Marcel Holtmann
2006-09-21 19:59                 ` Ulisses Furquim
2006-09-21 20:05                   ` Marcel Holtmann
2006-09-22 17:47                     ` Ulisses Furquim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d23110170609221047m4e0986fdt5c73b898eb84429f@mail.gmail.com \
    --to=ulissesf@gmail.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox