time_t vs long type confusion
There is some confusion around the tv_sec
and tv_usec
types used by sn_startup_sequence_get_initiated_time
and sn_startup_sequence_get_last_active_time
.
With a7e49fef it changed from long
to time_t
due to some systems have a 64 bit time_t (OpenBSD and musl libc), while long
may be 32 bit. This change has not yet been included in any release.
Meanwhile, some projects uses long
when calling startup-notification and others uses time_t
. This leads to crashes on musl libc where time_t
is 64 bit even if long
is 32. The compiler does not catch when breakage happens, since it is pointers to those types that are passed.
To fix this we can either break the API and ABI in a way so compiler picks it up. This will force projects to fix how they call startup-notification.
The other option is to extend the API/ABI so we keep ABI compatibility, and deprecate the current sn_startup_sequence_get_initiated_time
and sn_startup_sequence_get_last_active_time
functions.
Downstream commits and issues: