From 9adc84ea882cf3d64a19c2469d616a8ff006927d Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Thu, 20 Jan 2011 12:55:13 +0200 Subject: core: Always return success to a no-op A SetProperty that doesn't actually change the Online property's state when no change to that state is pending, should not fail. It should always succeed regardless of the current modem state. --- src/modem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modem.c b/src/modem.c index f587766c..e966a6e4 100644 --- a/src/modem.c +++ b/src/modem.c @@ -580,15 +580,15 @@ static DBusMessage *set_property_online(struct ofono_modem *modem, if (modem->pending != NULL) return __ofono_error_busy(msg); + if (modem->online == online) + return dbus_message_new_method_return(msg); + if (driver->set_online == NULL) return __ofono_error_not_implemented(msg); if (modem->modem_state < MODEM_STATE_OFFLINE) return __ofono_error_not_available(msg); - if (modem->online == online) - return dbus_message_new_method_return(msg); - modem->pending = dbus_message_ref(msg); driver->set_online(modem, online, -- cgit v1.2.3