Re: [PATCH 2/2] lib: Use SOCK_CLOEXEC where needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux