Skip to content

Commit

Permalink
Remove unused dbus_get_pid_from_bus_name()
Browse files Browse the repository at this point in the history
If something like this is needed later on, it must be re-implemented
without using dbus_send_with_block().
  • Loading branch information
spiiroin committed Aug 25, 2014
1 parent 20477bd commit dafd4a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
26 changes: 0 additions & 26 deletions mce-dbus.c
Expand Up @@ -720,32 +720,6 @@ DBusMessage *dbus_send_with_block(const gchar *const service,
return reply;
}

/**
* Translate a D-Bus bus name into a pid
*
* @param bus_name A string with the bus name
* @return The pid of the process, or -1 if no process could be identified
*/
pid_t dbus_get_pid_from_bus_name(const gchar *const bus_name)
{
dbus_uint32_t pid = -1;
DBusMessage *reply;

if ((reply = dbus_send_with_block("org.freedesktop.DBus",
"/org/freedesktop/DBus/Bus",
"org.freedesktop.DBus",
"GetConnectionUnixProcessID", -1,
DBUS_TYPE_STRING, &bus_name,
DBUS_TYPE_INVALID)) != NULL) {
dbus_message_get_args(reply, NULL,
DBUS_TYPE_UINT32, &pid,
DBUS_TYPE_INVALID);
dbus_message_unref(reply);
}

return (pid_t)pid;
}

/**
* D-Bus callback for the version get method call
*
Expand Down
1 change: 0 additions & 1 deletion mce-dbus.h
Expand Up @@ -58,7 +58,6 @@ DBusMessage *dbus_send_with_block(const gchar *const service,
const gchar *const interface,
const gchar *const name,
gint timeout, int first_arg_type, ...);
pid_t dbus_get_pid_from_bus_name(const gchar *const bus_name);

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

0 comments on commit dafd4a1

Please sign in to comment.