summaryrefslogtreecommitdiff
path: root/libgps_dbus.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-09-27 14:50:59 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-09-27 14:50:59 -0400
commitc7d7030b8881be73bbbe1492ef4ddd6892d81a2f (patch)
treee9e3575c6e1a4a57859c085edf7e2ee2b1bc113a /libgps_dbus.c
parentd0c9777345d50ac189f88914f3980b2fc8161035 (diff)
downloadgpsd-c7d7030b8881be73bbbe1492ef4ddd6892d81a2f.tar.gz
More refactoring.
gpxlogger currently works with socket and DBUS methods but fails with a segfault in the shm code.
Diffstat (limited to 'libgps_dbus.c')
-rw-r--r--libgps_dbus.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libgps_dbus.c b/libgps_dbus.c
index 5e124f32..56ded895 100644
--- a/libgps_dbus.c
+++ b/libgps_dbus.c
@@ -127,23 +127,19 @@ int gps_dbus_open(struct gps_data_t *gpsdata)
return 0;
}
-int gps_dbus_stream(struct gps_data_t *unused UNUSED,
- unsigned int flags UNUSED,
- /*@null@*/ void *handler)
-{
- /* must refer to the static context here */
- PRIVATE(share_gpsdata)->handler = (void (*)(struct gps_data_t *))handler;
- return 0;
-}
-
-void gps_dbus_mainloop(void)
+int gps_dbus_mainloop(struct gps_data_t *gpsdata,
+ int timeout UNUSED,
+ 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);
+ return 0;
}
#endif /* defined(DBUS_EXPORT_ENABLE) && !defined(S_SPLINT_S) */