summaryrefslogtreecommitdiff
path: root/leapsecond.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-01-15 01:31:28 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-01-15 01:34:23 -0500
commit4133c10e3cff4d2bd3c83952fac84bf78d8f34f1 (patch)
tree416ba45a2c7dff42ecf50d57a091dbdc2745fbb5 /leapsecond.py
parent42eba3edc67243742fe3a514bed292f3fac559e0 (diff)
downloadgpsd-4133c10e3cff4d2bd3c83952fac84bf78d8f34f1.tar.gz
GPS week rollover check extends to the rollover equivalent of now.
Diffstat (limited to 'leapsecond.py')
-rwxr-xr-xleapsecond.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/leapsecond.py b/leapsecond.py
index 55e622a9..89cc2927 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -171,6 +171,7 @@ if __name__ == '__main__':
continue
fields = line.strip().split()
leapsecs.append(leapbound(fields[0], fields[1]))
+ leapsecs.append(unix_to_rfc822(time.time()))
if c_epochs:
print '''
/* This code is generated from leapsecond.py; do not hand-hack! */
@@ -183,7 +184,11 @@ int gpsd_check_leapsecond(const int leap, const double unixtime)
static double c_epochs[] = {\
'''
for (i, b) in enumerate(leapsecs):
- print " %s, // %s -> %d" % (rfc822_to_unix(b), b, i)
+ if i == len(b) - 1:
+ label = '?'
+ else:
+ label = `i`
+ print " %s, // %s -> %s" % (rfc822_to_unix(b), b, label)
print '''\
};
#define DIM(a) (sizeof(a)/sizeof(a[0]))