technology: Return proper error code when already enabled
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Thu, 21 Jun 2012 10:39:16 +0000 (13:39 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 25 Jun 2012 06:47:58 +0000 (09:47 +0300)
We do not call the generic error message function because
it maps EALREADY to EINPROGRESS. So instead we call correct
error return function which returns AlreadyEnabled to the
caller.

Fixes BMC#25306

src/technology.c

index be688f2..013ac78 100644 (file)
@@ -609,7 +609,10 @@ done:
                        technology->pending_timeout = g_timeout_add_seconds(10,
                                        technology_pending_reply, technology);
                } else {
-                       reply = __connman_error_failed(msg, -err);
+                       if (err == -EALREADY)
+                               reply = __connman_error_already_enabled(msg);
+                       else
+                               reply = __connman_error_failed(msg, -err);
                        if (reply != NULL)
                                g_dbus_send_message(connection, reply);
                }