summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorYu A Wang <arron.wang@intel.com>2011-11-23 22:04:17 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2011-11-28 12:43:24 +0100
commit53f59e21154d6082a1ee1864a9dab86b5ef7f4ab (patch)
treeaa548cca057019e40b5dd8e228a7479aa7327e60 /src/technology.c
parent012bd3d307134928123b1479591bf754fe8713d3 (diff)
downloadconnman-53f59e21154d6082a1ee1864a9dab86b5ef7f4ab.tar.gz
connman-53f59e21154d6082a1ee1864a9dab86b5ef7f4ab.tar.bz2
connman-53f59e21154d6082a1ee1864a9dab86b5ef7f4ab.zip
technology: Save the pending reply only when the status is inprogress
For ethernet device, there is no need to save a pending reply as the technology enablement is synchronous. Fixes BMC#24249
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/technology.c b/src/technology.c
index 4c816f64..cfa79721 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -848,7 +848,6 @@ int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg
}
if (msg != NULL) {
- technology->pending_reply = dbus_message_ref(msg);
/*
* This is a bit of a trick. When msg is not NULL it means
* thats technology_enable was invoked from the manager API. Hence we save
@@ -881,14 +880,17 @@ int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg
}
done:
- if (ret == 0)
+ if (ret == 0) {
+ g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
return ret;
+ }
if (msg != NULL) {
- if (err == -EINPROGRESS)
+ if (err == -EINPROGRESS) {
+ technology->pending_reply = dbus_message_ref(msg);
technology->pending_timeout = g_timeout_add_seconds(10,
technology_pending_reply, technology);
- else {
+ } else {
reply = __connman_error_failed(msg, -err);
if (reply != NULL)
g_dbus_send_message(connection, reply);
@@ -949,7 +951,6 @@ int __connman_technology_disable(enum connman_service_type type, DBusMessage *ms
set_tethering(technology, FALSE);
if (msg != NULL) {
- technology->pending_reply = dbus_message_ref(msg);
technology->enable_persistent = FALSE;
save_state(technology);
}
@@ -965,14 +966,17 @@ int __connman_technology_disable(enum connman_service_type type, DBusMessage *ms
}
done:
- if (ret == 0)
+ if (ret == 0) {
+ g_dbus_send_reply(connection, msg, DBUS_TYPE_INVALID);
return ret;
+ }
if (msg != NULL) {
- if (err == -EINPROGRESS)
+ if (err == -EINPROGRESS) {
+ technology->pending_reply = dbus_message_ref(msg);
technology->pending_timeout = g_timeout_add_seconds(10,
technology_pending_reply, technology);
- else {
+ } else {
reply = __connman_error_failed(msg, -err);
if (reply != NULL)
g_dbus_send_message(connection, reply);