summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tdecore/tdehw/hwlibdaemons/dbus/tde_dbus_hardwarecontrol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tdecore/tdehw/hwlibdaemons/dbus/tde_dbus_hardwarecontrol.c b/tdecore/tdehw/hwlibdaemons/dbus/tde_dbus_hardwarecontrol.c
index f17e9dea6..77200334e 100644
--- a/tdecore/tdehw/hwlibdaemons/dbus/tde_dbus_hardwarecontrol.c
+++ b/tdecore/tdehw/hwlibdaemons/dbus/tde_dbus_hardwarecontrol.c
@@ -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) {