Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-9839

Compilation error on Windows and several timezone issues

    XMLWordPrintable

Details

    Description

      Encountered compilation error while building agent on Windows:

      'timezone' undeclared identifier in src/libs/zbxsysinfo/common/system.c

      The problem is in these lines of system.c:

      #if defined(HAVE_TM_TM_GMTOFF)
      		gmtoff = tm->tm_gmtoff;
      #else
      		gmtoff = -timezone;
      #endif
      

      According to https://msdn.microsoft.com/en-us/library/ms235451%28v=vs.140%29.aspx and adjacent links, Microsoft abandoned standard in this aspect in favour of their own _underscored functions and global variables. I guess rewriting given piece of code in the following manner

      #if defined(HAVE_TM_TM_GMTOFF)
      		gmtoff = tm->tm_gmtoff;
      #else
      #ifdef _WINDOWS
      		gmtoff = -_timezone;
      #else
      		gmtoff = -timezone;
      #endif
      #endif
      

      should fix the issue. Or we can go even further and use "safer" functional equivalents".

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              glebs.ivanovskis Glebs Ivanovskis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: