Skip to content

Commit

Permalink
Remove unused dbus_send_with_block() function
Browse files Browse the repository at this point in the history
Future MCE code should never use blocking dbus ipc and thus the
helper for making them is removed.
  • Loading branch information
spiiroin committed Aug 25, 2014
1 parent fbe9f8a commit 60b80e1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 72 deletions.
66 changes: 0 additions & 66 deletions mce-dbus.c
Expand Up @@ -663,72 +663,6 @@ gboolean dbus_send(const gchar *const service, const gchar *const path,
return res;
}

/**
* Generic function to send D-Bus messages, blocking version
*
* @param service D-Bus service
* @param path D-Bus path
* @param interface D-Bus interface
* @param name The D-Bus method to send to
* @param timeout The reply timeout in milliseconds to use
* @param first_arg_type The DBUS_TYPE of the first argument in the list
* @param ... The arguments to append to the D-Bus message;
* terminate with DBUS_TYPE_INVALID
* Note: the arguments MUST be passed by reference
* @return A new DBusMessage with the reply on success, NULL on failure
*/
DBusMessage *dbus_send_with_block(const gchar *const service,
const gchar *const path,
const gchar *const interface,
const gchar *const name,
gint timeout, int first_arg_type, ...)
{
DBusMessage *reply = NULL;
DBusMessage *msg = NULL;
va_list var_args;
DBusError error;

/* Register error channel */
dbus_error_init(&error);

msg = dbus_new_method_call(service, path, interface, name);

/* Append the arguments, if any */
va_start(var_args, first_arg_type);

if (first_arg_type != DBUS_TYPE_INVALID) {
if (dbus_message_append_args_valist(msg,
first_arg_type,
var_args) == FALSE) {
mce_log(LL_CRIT,
"Failed to append arguments to D-Bus message "
"for %s.%s",
interface, name);
dbus_message_unref(msg);
goto EXIT;
}
}

/* Call the method */
reply = dbus_connection_send_with_reply_and_block(dbus_connection, msg,
timeout, &error);

dbus_message_unref(msg);

if (dbus_error_is_set(&error) == TRUE) {
mce_log(LL_ERR,
"Error sending with reply to %s.%s: %s",
interface, name, error.message);
dbus_error_free(&error);
reply = NULL;
}

EXIT:
va_end(var_args);

return reply;
}

/**
* D-Bus callback for the version get method call
*
Expand Down
6 changes: 0 additions & 6 deletions mce-dbus.h
Expand Up @@ -54,12 +54,6 @@ gboolean dbus_send_ex(const char *service,
DBusPendingCall **ppc,
int first_arg_type, ...);

DBusMessage *dbus_send_with_block(const gchar *const service,
const gchar *const path,
const gchar *const interface,
const gchar *const name,
gint timeout, int first_arg_type, ...);

gconstpointer mce_dbus_handler_add_ex(const gchar *const interface,
const gchar *const name,
const gchar *const args,
Expand Down

0 comments on commit 60b80e1

Please sign in to comment.