2005-06-21 15:17:34

by Luiz Fernando Capitulino

[permalink] [raw]
Subject: [PATCH] - Some errno usage fixes (bluez-libs).

Hi there!

The bluez-libs functions hci_for_each_dev(), hci_devinfo() and
hci_inquiry() don't save the 'errno' value when an error occurs.
This causes the value of 'errno' to be overwrinting on some kind
of errors.

The attached patch fixes it. Note that was necessary to change
hci_inquiry() a bit, and I've added the missing error code to 'errno'
when a device is not found by hci_for_each_dev(), it fixes things like
that:

~/ hcitool scan
Device is not available: Success
~/

src/hci.c | 70 ++++++++++++++++++++++++++++++++++++--------------------------
1 files changed, 41 insertions(+), 29 deletions(-)

Thank you,

--
Luiz Fernando N. Capitulino


Attachments:
bluez_libs_errno_usage.patch (2.65 kB)

2005-06-21 16:50:21

by Marcel Holtmann

[permalink] [raw]
Subject: [Bluez-devel] Re: [PATCH] - Some errno usage fixes (bluez-libs).

Hi Luiz,

> The bluez-libs functions hci_for_each_dev(), hci_devinfo() and
> hci_inquiry() don't save the 'errno' value when an error occurs.
> This causes the value of 'errno' to be overwrinting on some kind
> of errors.
>
> The attached patch fixes it. Note that was necessary to change
> hci_inquiry() a bit, and I've added the missing error code to 'errno'
> when a device is not found by hci_for_each_dev(), it fixes things like
> that:

thanks for the patch. A slight modified version is in the CVS now.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel