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

Compilation error on Windows and several timezone issues

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.0alpha2
    • Fix Version/s: 3.0.3rc1, 3.2.0alpha1
    • Component/s: Agent (G)
    • Environment:
      Windows Server 2012 R2, Visual Studio 2015

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: