Re: [PATCH] device: Return error when ConnectProfile DBus method fails (second fix)

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

 



Hi Pali,

On Sun, Apr 26, 2020 at 2:05 PM Pali Rohár <pali@xxxxxxxxxx> wrote:
>
> This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is
> another place which needs to distinguish between Connect and ConnectProfile
> DBus method.
> ---
>  src/device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/device.c b/src/device.c
> index 229579378..7b0eb256e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
>         dev->pending = create_pending_list(dev, uuid);
>         if (!dev->pending) {
>                 if (dev->svc_refreshed) {
> -                       if (find_service_with_state(dev->services,
> +                       if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
> +                                                       "Connect") &&
> +                               find_service_with_state(dev->services,
>                                                 BTD_SERVICE_STATE_CONNECTED))

Perhaps it would be better to have a helper function that checks this for us.

>                                 return dbus_message_new_method_return(msg);
>                         else
> --
> 2.20.1
>


-- 
Luiz Augusto von Dentz




[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