On Tue, 2009-06-30 at 12:34 +0100, Joshua Lock wrote:
> On Tue, 2009-06-30 at 12:30 +0100, Joshua Lock wrote:
> > Hi,
> > 
> > When using the D-Bus API I've found that both Device and Manager have a
> > property each where when using SetProperty they return an invalid
> > arguments error when setting the property to the same value as is
> > already set.
> > 
> > This seems a bit draconian so I've attached a patch to return silently
> > instead.
> 
> Of course, it doesn't build and I didn't check before sending.
> What an idiot ...

Correct patch attached

> 
> > 
> > Regards,
> > Joshua
> > _______________________________________________
> > connman mailing list
> > [email protected]
> > http://lists.connman.net/listinfo/connman
-- 
Joshua Lock
        Intel Open Source Technology Centre
>From a831157bd57f568135e453877dc2ac2bfd3bba77 Mon Sep 17 00:00:00 2001
From: Joshua Lock <[email protected]>
Date: Tue, 30 Jun 2009 12:12:46 +0100
Subject: [PATCH] Don't return error when trying to set the same property value

---
 src/device.c  |    2 +-
 src/manager.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index 347f651..bc81d42 100644
--- a/src/device.c
+++ b/src/device.c
@@ -366,7 +366,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 		dbus_message_iter_get_basic(&value, &powered);
 
 		if (device->powered == powered)
-			return __connman_error_invalid_arguments(msg);
+                        return NULL;
 
 		if (device->pending != NULL)
 			return __connman_error_in_progress(msg);
diff --git a/src/manager.c b/src/manager.c
index a6c6021..0b6f6f9 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -201,7 +201,7 @@ static DBusMessage *set_property(DBusConnection *conn,
 		dbus_message_iter_get_basic(&value, &offlinemode);
 
 		if (global_offlinemode == offlinemode)
-			return __connman_error_invalid_arguments(msg);
+                        return NULL;
 
 		global_offlinemode = offlinemode;
 
-- 
1.6.2.5

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

Reply via email to