summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-18 10:55:19 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-18 10:55:19 -0400
commita6d4b2465ace7dfc0ab10668e4ec5de5fa0cc5d8 (patch)
tree2279d2ffe38b191e000c717c9bbdc8aa8534c13d /gpsmon.c
parent31bc58a3d9c8fdb9e0ba601b969903d993fbd459 (diff)
downloadgpsd-a6d4b2465ace7dfc0ab10668e4ec5de5fa0cc5d8.tar.gz
Make gpsmon work again. Compare drivers by name rather than structure address.
I'm not sure I understand the bug this is fixing. It looks as though the new build has made the location of driver pointers unstable? Perhaps this has something to do with different handling of shared libraries.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 968148a2..977ab5df 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -405,9 +405,12 @@ static bool switch_type(const struct gps_type_t *devtype)
{
const struct monitor_object_t **trial, **newobject;
newobject = NULL;
- for (trial = monitor_objects; *trial; trial++)
- if ((*trial)->driver == devtype)
+ for (trial = monitor_objects; *trial; trial++) {
+ if (strcmp((*trial)->driver->type_name, devtype->type_name)==0) {
newobject = trial;
+ break;
+ }
+ }
if (newobject) {
int leftover;
if (LINES < (*newobject)->min_y + 1 || COLS < (*newobject)->min_x) {