summaryrefslogtreecommitdiff
blob: c53eeca907b096a8c2cbd68d7d4e4a3f5550c489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
From 80cd103396fcd1185a476761bfb267ce12f64b32 Mon Sep 17 00:00:00 2001
From: Simon Dawson <spdawson@gmail.com>
Date: Mon, 25 Aug 2014 10:31:18 +0100
Subject: [PATCH] Fix build error when ntpshm is false

The build fails as follows

libgpsd_core.c: In function 'ntpshm_latch':
libgpsd_core.c:1660:24: error: 'const struct gps_type_t' has no member named 'time_offset'
  || device->device_type->time_offset == NULL)
                        ^
libgpsd_core.c:1663:33: error: 'const struct gps_type_t' has no member named 'time_offset'
  fix_time += device->device_type->time_offset(device);
                                 ^
scons: *** [libgpsd_core.os] Error 1

The solution is to wrap #ifdef NTPSHM_ENABLE around the ntpshm_latch function

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 libgpsd_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libgpsd_core.c b/libgpsd_core.c
index 6ec08a4..f7e8075 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1638,6 +1638,7 @@ void gpsd_zero_satellites( /*@out@*/ struct gps_data_t *out)
 #endif
 }
 
+#ifdef NTPSHM_ENABLE
 void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td)
 /* latch the fact that we've saved a fix */
 {
@@ -1668,5 +1669,6 @@ void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td)
     device->last_fixtime.clock = td->clock.tv_sec + td->clock.tv_nsec / 1e9;
 #endif /* S_SPLINT_S */
 }
+#endif /* NTPSHM_ENABLE */
 
 /* end */
-- 
2.1.2

From 48caee55069bdb7f7115e1930ace3914f4ddfe3b Mon Sep 17 00:00:00 2001
From: Simon Dawson <spdawson@gmail.com>
Date: Wed, 3 Sep 2014 18:43:31 +0100
Subject: [PATCH] Complete wrapping of ntpshm_latch function in #ifdef
 NTPSHM_ENABLE

Currently, the build fails as follows

gpsmon.o: In function `gpsmon_hook':
gpsmon.c:(.text+0x8b0): undefined reference to `ntpshm_latch'
collect2: error: ld returned 1 exit status
scons: *** [gpsmon] Error 1

Addresses Sacannah bug #43129: ntpshm patch is incomplete.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 gpsd.h-tail | 2 ++
 gpsmon.c    | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/gpsd.h-tail b/gpsd.h-tail
index 7b62ce1..7b44f91 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -857,7 +857,9 @@ extern unsigned int ais_binary_encode(struct ais_t *ais, /*@out@*/unsigned char
 extern void ntpshm_context_init(struct gps_context_t *);
 extern void ntpshm_session_init(struct gps_device_t *);
 extern int ntpshm_put(struct gps_device_t *, int, struct timedrift_t *);
+#ifdef NTPSHM_ENABLE
 extern void ntpshm_latch(struct gps_device_t *device,  /*@out@*/struct timedrift_t *td);
+#endif /* NTPSHM_ENABLE */
 extern void ntpshm_link_deactivate(struct gps_device_t *);
 extern void ntpshm_link_activate(struct gps_device_t *);
 
diff --git a/gpsmon.c b/gpsmon.c
index c812063..909f271 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -734,8 +734,10 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED)
 
     report_unlock();
 
+#ifdef NTPSHM_ENABLE
     /* Update the last fix time seen for PPS. FIXME: do this here? */
     ntpshm_latch(device, &td);
+#endif /* NTPSHM_ENABLE */
 }
 /*@+observertrans +nullpass +globstate +compdef +uniondef@*/
 
-- 
2.1.2