[systemd-devel] [PATCH] timesync: Use UINT64_C for OFFSET_1900_1970

David Herrmann dh.herrmann at gmail.com
Mon Feb 16 09:47:16 PST 2015


Hi

On Mon, Feb 16, 2015 at 5:24 PM, Cristian Rodríguez
<crrodriguez at opensuse.org> wrote:
> So it matches what the comment says in both 32 and 64 bit systems.
> ---
>  src/timesync/timesyncd-manager.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
> index 223671c..73ac7ee 100644
> --- a/src/timesync/timesyncd-manager.c
> +++ b/src/timesync/timesyncd-manager.c
> @@ -98,7 +98,7 @@
>   * "NTP timestamps are represented as a 64-bit unsigned fixed-point number,
>   * in seconds relative to 0h on 1 January 1900."
>   */
> -#define OFFSET_1900_1970        2208988800UL
> +#define OFFSET_1900_1970        UINT64_C(2208988800)

UINT64_C? Ugh... inttypes.h madness. "ULL" would do the same job,
right? I now applied this patch as it fixed issues where we compute
time-offsets with neither operand being 64bit. Not sure any of those
was a real bug, though.

Thanks
David

>
>  #define RETRY_USEC (30*USEC_PER_SEC)
>  #define RATELIMIT_INTERVAL_USEC (10*USEC_PER_SEC)
> --
> 2.2.2
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list