diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-03-10 15:27:59 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-03-15 11:12:56 -0400 |
commit | 9fbf00c7802719becd633ecbc45879d5d0ddb985 (patch) | |
tree | c38722bd78d605b26d76c24d6c13bd45bc0936bf /src/sbus/sssd_dbus.h | |
parent | 065b4307c33407e28f28fdba1aee2747b88b0984 (diff) | |
download | sssd-9fbf00c7802719becd633ecbc45879d5d0ddb985.tar.gz sssd-9fbf00c7802719becd633ecbc45879d5d0ddb985.tar.xz sssd-9fbf00c7802719becd633ecbc45879d5d0ddb985.zip |
Properly handle dbus send attempts on a closed connection
dbus_connection_send_with_reply() will report success and return
a NULL pending_reply when the connection is not open for
communication. This patch creates a new wrapper around
dbus_connection_send_with_reply() to properly detect this
condition and report it as an error.
Diffstat (limited to 'src/sbus/sssd_dbus.h')
-rw-r--r-- | src/sbus/sssd_dbus.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus.h b/src/sbus/sssd_dbus.h index ac02c4440..2dbf4ab77 100644 --- a/src/sbus/sssd_dbus.h +++ b/src/sbus/sssd_dbus.h @@ -144,6 +144,22 @@ DBusHandlerResult sbus_message_handler(DBusConnection *conn, DBusMessage *message, void *user_data); +/* + * Send a message across the SBUS + * If requested, the DBusPendingCall object will + * be returned to the caller. + * + * This function will return EAGAIN in the event + * that the connection is not open for + * communication. + */ +int sbus_conn_send(struct sbus_connection *conn, + DBusMessage *msg, + int timeout_ms, + DBusPendingCallNotifyFunction reply_handler, + void *pvt, + DBusPendingCall **pending); + void sbus_conn_send_reply(struct sbus_connection *conn, DBusMessage *reply); |