Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: "Cristian Rodríguez" <crrodriguez@opensuse.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] lib: Use SOCK_CLOEXEC where needed
Date: Mon, 24 Dec 2012 09:13:11 -0800	[thread overview]
Message-ID: <1356369191.29264.45.camel@aeonflux> (raw)
In-Reply-To: <1356367487-1610-1-git-send-email-crrodriguez@opensuse.org>

Hi Cristian,

> Calling programs might fork().. execve() and we will end
> up leaking fds.
> ---
>  lib/hci.c |  8 ++++----
>  lib/sdp.c | 13 ++++++-------
>  2 files changed, 10 insertions(+), 11 deletions(-)

you need to pay more attention to your patches.

Applying: lib: Use SOCK_CLOEXEC where needed
/data/devel/bluez/.git/rebase-apply/patch:64: trailing whitespace.
	
fatal: 1 line adds whitespace errors.
Patch failed at 0001 lib: Use SOCK_CLOEXEC where needed

I fixed this up now as well.

> diff --git a/lib/hci.c b/lib/hci.c
> index 66b2d5f..1f9058f 100644
> --- a/lib/hci.c
> +++ b/lib/hci.c
> @@ -817,7 +817,7 @@ int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg),
>  	int dev_id = -1;
>  	int i, sk, err = 0;
>  
> -	sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
> +	sk = socket(AF_BLUETOOTH, SOCK_RAW|SOCK_CLOEXEC, BTPROTO_HCI);

This needs an extra space between the socket flags. And so on...

Regards

Marcel



      reply	other threads:[~2012-12-24 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24 16:44 [PATCH 2/2] lib: Use SOCK_CLOEXEC where needed Cristian Rodríguez
2012-12-24 17:13 ` Marcel Holtmann [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=1356369191.29264.45.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=crrodriguez@opensuse.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /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