The previous version was written against gpsd 3.10. This also makes the
date more precise, previously microseconds were set to 0.
GPSD_API_MAJOR_VERSION is defined in gps.h, together with a changelog:
https://gitlab.com/gpsd/gpsd/-/blob/master/include/gps.h
Related: SYS#6222
We've observed several times that GPS receivers would report a wrong
time/date directly after boot, probably assuming that their RTC is
correct.
Let's wait until the receiver reports it has a fix and reports actual
satellites were used to compute it.
In some cases, gpsd might die while we are waiting to receive a valid
fix/time information. In that case, we have to reconnect to gpsd
again and again, until a valid time has been received (and set as
system clock).
This addresses and issue when gpsdate is running and the gpsd will be
killed (testing coredump handling).
The issue is within the libgps cod itself that doesn't handle the
result(0) of the recv syscall correctly and keeps on looping. Now in a
normal system gpsdate should only execute at the beginning and exit once
there is a date. So the window for this runtime failure is quite low.
Bug reported by Holger Freyther.