Skip to content

Commit

Permalink
Don't block for too long on device lock query, 1,5s should be ample t…
Browse files Browse the repository at this point in the history
…ime.

We don't want to block usb functionality for 20-30s

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Oct 8, 2013
1 parent f98550a commit 5c939ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/usb_moded-devicelock.c
Expand Up @@ -60,8 +60,9 @@ int usb_moded_get_export_permission(void)

if ((msg = dbus_message_new_method_call(DEVICELOCK_SERVICE, DEVICELOCK_REQUEST_PATH, DEVICELOCK_REQUEST_IF, DEVICELOCK_STATE_REQ)) != NULL)
{
if ((reply = dbus_connection_send_with_reply_and_block(dbus_conn_devicelock, msg, -1, NULL)) != NULL)
{
/* default dbus timeout is too long, timeout after 1,5 seconds */
if ((reply = dbus_connection_send_with_reply_and_block(dbus_conn_devicelock, msg, 1500, NULL)) != NULL)
{
dbus_message_get_args(reply, NULL, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
dbus_message_unref(reply);
}
Expand Down

0 comments on commit 5c939ae

Please sign in to comment.