Ad Widget

Collapse

Inconsistency int/time_t

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    Inconsistency int/time_t

    Hi

    during the compilation of the Windows (64-bit) Agent, the compiler
    issued a warning about truncation of value.
    This is quite right, but will happen after Jan. 2038, only.
    But still, this fix will solve it and there should be no portability
    problems with my change, because a few lines above the change,
    the type time_t is used, too.
    It's a trivial change. Just replaced int by time_t.

    Code:
    --- diskdevices.c.orig  2009-03-06 11:00:04.000000000 +0100
    +++ diskdevices.c       2009-03-18 13:30:00.583680000 +0100
    @@ -26,7 +26,7 @@
                    zbx_uint64_t r_oper, zbx_uint64_t r_sect, zbx_uint64_t w_oper, zbx_uint64_t w_sect)
     {
            register int    i;
    -       int             clock[ZBX_AVGMAX], index[ZBX_AVGMAX];
    +       time_t          clock[ZBX_AVGMAX], index[ZBX_AVGMAX];
    
            assert(device);
    Include it in the next release or, at least, the one prior to Jan. 2038

    Regards

    Norbert.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Thanks for pointing to the potential problem.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...