check return value
This commit is contained in:
parent
1979ced0e0
commit
a2f2b93e36
2 changed files with 13 additions and 2 deletions
|
@ -126,7 +126,10 @@ int main(int argc, char *argv[])
|
|||
|
||||
dispatcher.attach(NULL);
|
||||
|
||||
// activate one of both for either system or session bus
|
||||
// TODO: choose in the GUI
|
||||
DBus::Connection conn = DBus::Connection::SessionBus();
|
||||
//DBus::Connection conn = DBus::Connection::SystemBus();
|
||||
|
||||
DBusBrowser browser(conn);
|
||||
|
||||
|
|
|
@ -384,9 +384,17 @@ void Connection::request_name(const char *name, int flags)
|
|||
|
||||
debug_log("%s: registering bus name %s", unique_name(), name);
|
||||
|
||||
dbus_bus_request_name(_pvt->conn, name, flags, e); //we deliberately don't check return value
|
||||
/*
|
||||
* TODO:
|
||||
* Think about giving back the 'ret' value. Some people on the list
|
||||
* requested about this...
|
||||
*/
|
||||
int ret = dbus_bus_request_name(_pvt->conn, name, flags, e);
|
||||
|
||||
if (e) throw Error(e);
|
||||
if (ret == -1)
|
||||
{
|
||||
if (e) throw Error(e);
|
||||
}
|
||||
|
||||
// this->remove_match("destination");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue