vpn-provider: Report disconnect errors other than -EINPROGRESS
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 14 Dec 2012 11:01:19 +0000 (13:01 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 14 Dec 2012 14:17:48 +0000 (16:17 +0200)
Return code -EINPROGRESS is an indication of a disconnect taking place,
not a disconnect error.

vpn/vpn-provider.c

index e98573f..4c9fa15 100644 (file)
@@ -457,10 +457,10 @@ static DBusMessage *do_disconnect(DBusConnection *conn, DBusMessage *msg,
        DBG("conn %p provider %p", conn, provider);
 
        err = __vpn_provider_disconnect(provider);
-       if (err < 0)
+       if (err < 0 && err != -EINPROGRESS)
                return __connman_error_failed(msg, -err);
-       else
-               return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
+
+       return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
 static const GDBusMethodTable connection_methods[] = {