summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-12-04 09:47:01 -0500
committerChris Michael <cp.michael@samsung.com>2014-12-04 09:49:02 -0500
commit34dd248551679b493bb616a48b3f8be88a274f1f (patch)
tree5bbc8d17750aba010971dbbc9b51379702a4b843
parent14332f5d0dd503c10c284357a9b9183567644c4f (diff)
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 <cp.michael@samsung.com>
-rw-r--r--src/lib/eldbus/eldbus_pending.c25
1 files changed, 25 insertions, 0 deletions
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
158 return NULL; 158 return NULL;
159} 159}
160 160
161Eldbus_Message *
162_eldbus_connection_send_and_block(Eldbus_Connection *conn, Eldbus_Message *msg)
163{
164 Eldbus_Message *reply;
165
166 if (ecore_main_loop_nested_get())
167 WRN("Calling this function may result in dropped frames because the main loop is running");
168
169 reply = eldbus_message_new(EINA_TRUE);
170 EINA_SAFETY_ON_NULL_GOTO(reply, fail);
171
172 reply->dbus_msg =
173 dbus_connection_send_with_reply_and_block(conn->dbus_conn,
174 msg->dbus_msg, -1, NULL);
175
176 dbus_message_iter_init_append(reply->dbus_msg,
177 &reply->iterator->dbus_iterator);
178
179 return reply;
180
181fail:
182 eldbus_message_unref(reply);
183 return NULL;
184}
185
161EAPI void 186EAPI void
162eldbus_pending_data_set(Eldbus_Pending *pending, const char *key, const void *data) 187eldbus_pending_data_set(Eldbus_Pending *pending, const char *key, const void *data)
163{ 188{