[tz] defensive value for define on Solaris causes load of timerule to fail

Kees Dekker Kees.Dekker at infor.com
Mon Jun 12 13:37:25 UTC 2017


>#if FILENAME_MAX < 260
>#define TZ_FILENAME_MAX 260
>#else
>#define TZ_FILENAME_MAX FILENAME_MAX
>#endif

Better approach:

#if !defined(FILENAME_MAX) || FILENAME_MAX < 260
// e.g. Solaris uses a too small value to hold a path
#define TZ_FILENAME_MAX 260
#else
#define TZ_FILENAME_MAX FILENAME_MAX
#endif

/* Local storage needed for 'tzloadbody'.  */
union local_storage {
  /* The file name to be opened.  */
  char fullname[TZ_FILENAME_MAX + 1];

  /* The results of analyzing the file's contents after it is opened.  */
  struct {
    /* The input buffer.  */
    union input_buffer u;

    /* A temporary state used for parsing a TZ string in the file.  */
    struct state st;
  } u;
};


More information about the tz mailing list