diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-10-03 09:26:45 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-10-03 09:26:45 -0400 |
commit | ecf1b666629bd74e4b5e28ec0edd1f787c737476 (patch) | |
tree | cd4965d6b1a812d36323a31e4b724e039d4e694c /libgps_dbus.c | |
parent | 9cd197eac3d6d1e9ef2d25ca9434d85e74224b0a (diff) | |
download | gpsd-ecf1b666629bd74e4b5e28ec0edd1f787c737476.tar.gz |
Remove a dependency on the Gnome libraries.
Diffstat (limited to 'libgps_dbus.c')
-rw-r--r-- | libgps_dbus.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libgps_dbus.c b/libgps_dbus.c index 4a6e2f71..553d8e4e 100644 --- a/libgps_dbus.c +++ b/libgps_dbus.c @@ -23,12 +23,7 @@ struct privdata_t void (*handler)(struct gps_data_t *); }; -#include <glib.h> #include <dbus/dbus.h> -#include <dbus/dbus-glib-lowlevel.h> -#include <dbus/dbus-glib.h> - -#include <glib/gprintf.h> /* * Unpleasant that we have to declare a static context pointer here - means @@ -133,17 +128,15 @@ int gps_dbus_open(struct gps_data_t *gpsdata) } int gps_dbus_mainloop(struct gps_data_t *gpsdata, - int timeout UNUSED, + int timeout, void (*hook)(struct gps_data_t *)) /* run a DBUS main loop with a specified handler */ { - GMainLoop *mainloop; - share_gpsdata = gpsdata; PRIVATE(share_gpsdata)->handler = (void (*)(struct gps_data_t *))hook; - mainloop = g_main_loop_new(NULL, FALSE); - dbus_connection_setup_with_g_main(connection, NULL); - g_main_loop_run(mainloop); + for (;;) + if (dbus_connection_read_write_dispatch(connection, timeout * 1000) != TRUE) + return -1; return 0; } |