If an error happens at connect time and there is still a pending call
present indicating the error has not been handled, return error. With
no pending call present, the error has already been signalled.
---
 src/service.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/service.c b/src/service.c
index cfc9cd1..b98b1de 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3989,11 +3989,9 @@ static DBusMessage *connect_service(DBusConnection *conn,
 
        err = __connman_service_connect(service,
                        CONNMAN_SERVICE_CONNECT_REASON_USER);
-       if (err < 0) {
-               if (!service->pending)
-                       return NULL;
 
-               if (err != -EINPROGRESS) {
+       if (err < 0 && err != -EINPROGRESS) {
+               if (service->pending) {
                        dbus_message_unref(service->pending);
                        service->pending = NULL;
 
-- 
1.8.5.3

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to