summaryrefslogtreecommitdiff
path: root/recipes-navigation/gpsd/gpsd-3.23.1/0006-itu_r_tf_460_6.patch
blob: e17cfadc7edb3c7211ade7eb9561104b64c88f02 (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
From 799f41e6bf0955d04510f16b33cdf731d27a597a Mon Sep 17 00:00:00 2001
From: Mykyta Dorokhin <mykyta.dorokhin@globallogic.com>
Date: Tue, 28 Dec 2021 15:46:42 +0200
Subject: [PATCH] Reintegrate 0006-itu_r_tf_460_6.patch

---
 gpsd/ntpshmwrite.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gpsd/ntpshmwrite.c b/gpsd/ntpshmwrite.c
index 3f2ded3..5f0524b 100644
--- a/gpsd/ntpshmwrite.c
+++ b/gpsd/ntpshmwrite.c
@@ -39,11 +39,20 @@ void ntp_write(volatile struct shmTime *shmseg,
      * ITU-R TF.460-6, Section 2.1, says laep seconds can be primarily
      * in Jun/Dec but may be in March or September
      */
+
+/* This code contradicts page 3 section 2.1 of ITU-R RV.460-6 that
+ * leap second may occur at the last second of a month, with
+ * preference for December and June, 2nd preference to March and
+ * September.
+ *  https://www.itu.int/dms_pubrec/itu-r/rec/tf/R-REC-TF.460-6-200202-I!!PDF-E.pdf
+ */
+#ifdef NOTITU_R_TF_460_6
     (void)gmtime_r( &(td->real.tv_sec), &tm);
     if ( 5 != tm.tm_mon && 11 != tm.tm_mon ) {
         /* Not june, not December, no way */
         leap_notify = LEAP_NOWARNING;
     }
+#endif /* NOTITU_R_TF_460_6 */
 
     /* we use the shmTime mode 1 protocol
      *
-- 
2.25.1