summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-10-10 11:40:48 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-10-10 17:33:40 +0100
commitdf47bd40818683a0567081e7bc71b870ee4ec642 (patch)
treed60e9e7b77fa9e44b3dd82b8d90e31e60e194c4b
parentd7fbcb5e025b3c718dd1fd332b8759ae26c0d8dc (diff)
_dbus_object_tree_register: don't duplicate check for NULL and use new DBUS_ERROR_OBJECT_PATH_IN_USE error, both as per Havoc's review
-rw-r--r--dbus/dbus-object-tree.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/dbus/dbus-object-tree.c b/dbus/dbus-object-tree.c
index 276ac955..953aa3bd 100644
--- a/dbus/dbus-object-tree.c
+++ b/dbus/dbus-object-tree.c
@@ -383,7 +383,7 @@ static char *flatten_path (const char **path);
* @param user_data user data to pass to methods in the vtable
* @param error address where an error can be returned
* @returns #FALSE if an error (#DBUS_ERROR_NO_MEMORY or
- * #DBUS_ERROR_ADDRESS_IN_USE) is reported
+ * #DBUS_ERROR_OBJECT_PATH_IN_USE) is reported
*/
dbus_bool_t
_dbus_object_tree_register (DBusObjectTree *tree,
@@ -402,9 +402,7 @@ _dbus_object_tree_register (DBusObjectTree *tree,
subtree = ensure_subtree (tree, path);
if (subtree == NULL)
{
- if (error != NULL)
- _DBUS_SET_OOM (error);
-
+ _DBUS_SET_OOM (error);
return FALSE;
}
@@ -414,7 +412,8 @@ _dbus_object_tree_register (DBusObjectTree *tree,
{
char *complete_path = flatten_path (path);
- dbus_set_error (error, DBUS_ERROR_ADDRESS_IN_USE, "A handler is already registered for %s",
+ dbus_set_error (error, DBUS_ERROR_OBJECT_PATH_IN_USE,
+ "A handler is already registered for %s",
complete_path ? complete_path
: "(cannot represent path: out of memory!)");