Fixed bug in TDE hw dbus daemon that would cause the daemon to go into

infinite loop if the connection was lost unexpectedly. Also fixed release
of connection on exit.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
feat/fix-suspend-code
Michele Calgaro 5 years ago
parent 841ae5477c
commit 880ff6da35
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -729,9 +729,9 @@ void listen() {
}
// loop, testing for new messages
while (true) {
// block for up to 1 second, exit in case the connection was lost
while (dbus_connection_read_write(conn, 1000)) {
// non blocking read of the next available message
dbus_connection_read_write(conn, 1000); // block for up to 1 second
msg = dbus_connection_pop_message(conn);
// loop again if we haven't got a message
@ -847,7 +847,7 @@ void listen() {
}
// close the connection
dbus_connection_close(conn);
dbus_connection_unref(conn);
}
int main(int argc, char** argv) {

Loading…
Cancel
Save