1
Fork 0

return explicit dbus void replies

This commit is contained in:
Nedko Arnaudov 2009-12-07 02:34:42 +02:00
parent e8a278820d
commit 13adaabad4
3 changed files with 22 additions and 0 deletions

9
dbus.c
View File

@ -126,6 +126,15 @@ fail_no_mem:
a2j_error("Ran out of memory trying to construct method return");
}
void a2j_dbus_construct_method_return_void(struct a2j_dbus_method_call * call_ptr)
{
call_ptr->reply = dbus_message_new_method_return(call_ptr->message);
if (call_ptr->reply == NULL)
{
a2j_error("Ran out of memory trying to construct method return");
}
}
#define descriptor_ptr ((struct a2j_dbus_object_descriptor *)data)
DBusHandlerResult

View File

@ -53,6 +53,7 @@ a2j_dbus_exit(
struct a2j_dbus_method_call * call_ptr)
{
g_keep_walking = false;
a2j_dbus_construct_method_return_void(call_ptr);
}
static void a2j_dbus_set_hw_export(struct a2j_dbus_method_call * call_ptr)
@ -82,6 +83,8 @@ static void a2j_dbus_set_hw_export(struct a2j_dbus_method_call * call_ptr)
g_a2j_export_hw_ports = hw_export;
a2j_info("Hardware ports %s be exported.", g_a2j_export_hw_ports ? "will": "will not");
a2j_dbus_construct_method_return_void(call_ptr);
}
static
@ -93,6 +96,10 @@ a2j_dbus_start(
{
a2j_dbus_error(call_ptr, A2J_DBUS_ERROR_GENERIC, "a2j_start() failed.");
}
else
{
a2j_dbus_construct_method_return_void(call_ptr);
}
}
static
@ -104,6 +111,10 @@ a2j_dbus_stop(
{
a2j_dbus_error(call_ptr, A2J_DBUS_ERROR_GENERIC, "a2j_stop() failed.");
}
else
{
a2j_dbus_construct_method_return_void(call_ptr);
}
}
static

View File

@ -194,6 +194,8 @@ a2j_dbus_construct_method_return_single(
int type,
void * arg_ptr);
void a2j_dbus_construct_method_return_void(struct a2j_dbus_method_call * call_ptr);
void
a2j_dbus_signal(
const char * path,