From: Zoltan B. <zol...@gm...> - 2009-09-08 14:01:34
|
Hello All, I'm trying to mount and unmount devices through dbus-c++ binding, using DeviceKit.Disks.Device interface methods. While trying to unmount device, I get a 'SIGTRAP' signal. Can anybody show me what I'm doing wrong in this code? Thanks, any help is very appreciated. // Proxy implementation DisksDeviceProxy::DisksDeviceProxy(DBus::Connection &connection, const char *object_path) : DBus::InterfaceProxy("org.freedesktop.DeviceKit.Disks"), DBus::ObjectProxy(connection, object_path, "org.freedesktop.DeviceKit.Disks.Device") { } // Mount device void DisksDeviceProxy::MountDevice(const char *fstype, std::vector<std::string> &options) { ::DBus::CallMessage call; ::DBus::MessageIter wi = call.writer(); wi << fstype; wi << options; call.member("FilesystemMount"); ::DBus::Message ret = invoke_method (call); ::DBus::MessageIter ri = ret.reader(); } // Unmount device void DisksDeviceProxy::UnMountDevice(std::vector<std::string> &options) { ::DBus::CallMessage call; ::DBus::MessageIter wi = call.writer(); wi << options; call.member("FilesystemUnmount"); ::DBus::Message ret = invoke_method (call); // Signaled SIGTRAP right here ::DBus::MessageIter ri = ret.reader(); } And here is the code, how I'm trying to unmount device: //-- START DBus::BusDispatcher dispatcher; DBus::default_dispatcher = &dispatcher; DBus::Connection conn = DBus::Connection::SystemBus(); DisksDeviceProxy devkit(conn, "/org/freedesktop/DeviceKit/Disks/devices/sdb1"); // for now, just hard coded value of my USB device std::vector<std::string>options; devkit.UnMountDevice(options); //-- END |