X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fglib.git;a=blobdiff_plain;f=gio%2Fgkdbus.c;h=312b34f49c89b223a2c0bc74c6a03be89ee2821b;hp=03c2d8ea8db5d8ae59b96d153aaa211b55c8c8f7;hb=472e727299d0525c82b6df97d557d2bf8cf915de;hpb=10566194f57f8a207c483fed65802cb24ae57a12 diff --git a/gio/gkdbus.c b/gio/gkdbus.c index 03c2d8e..312b34f 100644 --- a/gio/gkdbus.c +++ b/gio/gkdbus.c @@ -677,6 +677,7 @@ _g_kdbus_RequestName (GDBusConnection *connection, len = strlen(name) + 1; size = G_STRUCT_OFFSET (struct kdbus_cmd_name, items) + KDBUS_ITEM_SIZE(len); kdbus_name = g_alloca0 (size); + kdbus_name->size = size; kdbus_name->items[0].size = KDBUS_ITEM_HEADER_SIZE + len; kdbus_name->items[0].type = KDBUS_ITEM_NAME; kdbus_name->flags = kdbus_flags; @@ -690,7 +691,13 @@ _g_kdbus_RequestName (GDBusConnection *connection, else if (errno == EALREADY) status = G_BUS_REQUEST_NAME_REPLY_ALREADY_OWNER; else - return FALSE; + { + g_set_error (error, G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error while acquiring name: %s"), + g_strerror (errno)); + return NULL; + } } if (kdbus_name->flags & KDBUS_NAME_IN_QUEUE) @@ -750,6 +757,7 @@ _g_kdbus_ReleaseName (GDBusConnection *connection, len = strlen(name) + 1; size = G_STRUCT_OFFSET (struct kdbus_cmd_name, items) + KDBUS_ITEM_SIZE(len); kdbus_name = g_alloca0 (size); + kdbus_name->size = size; kdbus_name->items[0].size = KDBUS_ITEM_HEADER_SIZE + len; kdbus_name->items[0].type = KDBUS_ITEM_NAME; memcpy (kdbus_name->items[0].str, name, len); @@ -762,7 +770,13 @@ _g_kdbus_ReleaseName (GDBusConnection *connection, else if (errno == EADDRINUSE) status = G_BUS_RELEASE_NAME_REPLY_NOT_OWNER; else - return FALSE; + { + g_set_error (error, G_IO_ERROR, + g_io_error_from_errno (errno), + _("Error while releasing name: %s"), + g_strerror (errno)); + return NULL; + } } result = g_variant_new ("(u)", status);