On 9/13/2021 7:42 AM, Edward Tomasz Napierala wrote:
> +#else /* !DETECT_TZ_CHANGES */
> +#define      change_in_tz(X) 0

WITHOUT_DETECT_TZ_CHANGES: change_in_tz() == 0

> +#endif /* !DETECT_TZ_CHANGES */
> +
>  static int
>  differ_by_repeat(const time_t t1, const time_t t0)
>  {
> @@ -379,6 +418,7 @@ register const int        doextend;
>       int             stored;
>       int             nread;
>       int             res;
> +     int             ret;
>       union {
>               struct tzhead   tzhead;
>               char            buf[2 * sizeof(struct tzhead) +
> @@ -427,6 +467,22 @@ register const int       doextend;
>                       (void) strcat(fullname, name);
>                       name = fullname;
>               }
> +             if (doextend == TRUE) {
> +                     /*
> +                      * Detect if the timezone file has changed.  Check
> +                      * 'doextend' to ignore TZDEFRULES; the change_in_tz()
> +                      * function can only keep state for a single file.
> +                      */
> +                     ret = change_in_tz(name);
> +                     if (ret <= 0) {

WITHOUT_DETECT_TZ_CHANGES: Always returns a false-positive "done" but
short-circuits the rest of tzload().

> +                             /*
> +                              * Returns -1 if there was an error,
> +                              * and 0 if the timezone had not changed.
> +                              */
> +                             free(fullname);
> +                             return ret;
> +                     }
> +             }


-- 
Regards,
Bryan Drewery

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to