diff options
author | Robert Norris <rw_norris@hotmail.com> | 2017-03-04 18:59:27 +0000 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2017-03-04 14:20:59 -0800 |
commit | facde921457877842d71139f3dd8952989874864 (patch) | |
tree | b368054aef5b5cb67c71bb62665171fe5c06554f /libgps_dbus.c | |
parent | dcb8bb0483f9224fa211ca2617579ddd082c9a0f (diff) | |
download | gpsd-facde921457877842d71139f3dd8952989874864.tar.gz |
dbus timeout parameter is in milliseconds.
The value passed into gps_mainloop() and thuis gps_dbus_mainloop()
is in microseconds.
Thus to convert from microseconds to milliseconds, one needs to divide by
1000 (not multiply!).
This also prevents the timeout value overflowing, when a large value
timeout is passed in.
NB This timeout value appears not to be actually used by current versions
of dbus, see this bug: https://bugs.freedesktop.org/show_bug.cgi?id=100062
Signed-off-by: Fred Wright <fw@fwright.net>
Diffstat (limited to 'libgps_dbus.c')
-rw-r--r-- | libgps_dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgps_dbus.c b/libgps_dbus.c index 29cd0dd0..c5cffbf1 100644 --- a/libgps_dbus.c +++ b/libgps_dbus.c @@ -134,7 +134,7 @@ int gps_dbus_mainloop(struct gps_data_t *gpsdata, share_gpsdata = gpsdata; PRIVATE(share_gpsdata)->handler = (void (*)(struct gps_data_t *))hook; for (;;) - if (dbus_connection_read_write_dispatch(connection, timeout * 1000) != TRUE) + if (dbus_connection_read_write_dispatch(connection, (int)(timeout/1000)) != TRUE) return -1; return 0; } |