The "No response within specified time" error
Marko Anastasov
marko at marko.anastasov.name
Tue Jan 31 10:43:04 PST 2006
Hello,
I'm getting this error message while trying to mount
a usb flash, after calling dbus_connection_send_with_reply_and_block.
Does that mean that I'm not sending the message correctly?
Please take a look, I've ran out of ideas here. This is the code
(like in g-v-m and g-m):
// udi_ is a string and gets its value in the constructor
// from libhal_volume_get_udi
bool
FlashDrive::mount()
{
char* fstype, *mount_point;
char* options[0];
int noptions = 0;
DBusMessage *msg, *reply;
DBusError error;
g_debug("mounting %s...", udi_.c_str());
if (! (msg = dbus_message_new_method_call("org.freedesktop.Hal",
udi_.c_str(),
"org.freedesktop.Hal.Device.Volume",
"Mount")))
{
g_debug("mount failed for %s: could not create dbus message.",
udi_.c_str());
return false;
}
fstype = "";
mount_point = "";
options[0] = NULL;
noptions = 0;
if (! dbus_message_append_args(msg,
DBUS_TYPE_STRING, &mount_point,
DBUS_TYPE_STRING, &fstype,
DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
&options, noptions,
DBUS_TYPE_INVALID))
{
g_debug("mount failed for %s: could not append args to dbus
message", udi_.c_str());
dbus_message_unref(msg);
return false;
}
dbus_error_init (&error);
if (! (reply = dbus_connection_send_with_reply_and_block(dbus_conn_,
msg, -1, &error)))
{
g_debug("mount failed for %s: %s", udi_.c_str(), error.message);
dbus_message_unref(msg);
dbus_error_free(&error);
return false;
}
g_debug("mount command succeeded for %s", udi_.c_str());
dbus_message_unref(msg);
dbus_message_unref(reply);
return true;
}
Thanks,
Marko
(ps by clicking on the address in Vedran's last msg I accidentaly
sent this to hal at fd.org instead of here)
More information about the hal
mailing list