devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=34dd248551679b493bb616a48b3f8be88a274f1f

commit 34dd248551679b493bb616a48b3f8be88a274f1f
Author: Chris Michael <[email protected]>
Date:   Thu Dec 4 09:47:01 2014 -0500

    eldbus: Add code for _eldbus_connection_send_and_block function
    
    Summary: This function will send a message to dbus and block while
    waiting for a reply
    
    NB: This is needed for our 'port to libinput', and for our 'opening up the
    drm card without systemd' efforts
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/eldbus/eldbus_pending.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/lib/eldbus/eldbus_pending.c b/src/lib/eldbus/eldbus_pending.c
index bf561bb..87049c5 100644
--- a/src/lib/eldbus/eldbus_pending.c
+++ b/src/lib/eldbus/eldbus_pending.c
@@ -158,6 +158,31 @@ _eldbus_connection_send(Eldbus_Connection *conn, 
Eldbus_Message *msg, Eldbus_Mes
    return NULL;
 }
 
+Eldbus_Message *
+_eldbus_connection_send_and_block(Eldbus_Connection *conn, Eldbus_Message *msg)
+{
+   Eldbus_Message *reply;
+
+   if (ecore_main_loop_nested_get())
+     WRN("Calling this function may result in dropped frames because the main 
loop is running");
+
+   reply = eldbus_message_new(EINA_TRUE);
+   EINA_SAFETY_ON_NULL_GOTO(reply, fail);
+
+   reply->dbus_msg = 
+     dbus_connection_send_with_reply_and_block(conn->dbus_conn, 
+                                               msg->dbus_msg, -1, NULL);
+
+   dbus_message_iter_init_append(reply->dbus_msg, 
+                                 &reply->iterator->dbus_iterator);
+
+   return reply;
+
+fail:
+   eldbus_message_unref(reply);
+   return NULL;
+}
+
 EAPI void
 eldbus_pending_data_set(Eldbus_Pending *pending, const char *key, const void 
*data)
 {

-- 


Reply via email to