pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/40990: net-snmp package assumes struct timeval



The following reply was made to PR pkg/40990; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/40990: net-snmp package assumes struct timeval
Date: Mon, 9 Mar 2009 15:10:11 +0200

 On Mon, 09 Mar 2009, apb%cequrux.com@localhost wrote:
 > mibII/interfaces.c: In function 'var_ifEntry':
 > mibII/interfaces.c:833: error: 'struct timespec' has no member named 
 > 'tv_usec'
 > mibII/interfaces.c:840: error: 'struct timespec' has no member named 
 > 'tv_usec'
 
 The following patch works for me, but will break the build on systems
 other then NetBSD-current.  The change shown here needs to be made
 conditional on an autoconf test and some #if tests that refer to the
 result from autoconf.
 
 --- agent/mibgroup/mibII/interfaces.c.orig     2008-06-05 23:11:53.000000000 
+0200
 +++ agent/mibgroup/mibII/interfaces.c
 @@ -830,14 +830,14 @@ var_ifEntry(struct variable *vp,
           * * this is fixed, thus the 199607 comparison.
           */
          if (ifnet.if_lastchange.tv_sec == 0 &&
 -            ifnet.if_lastchange.tv_usec == 0)
 +            ifnet.if_lastchange.tv_nsec == 0)
              long_return = 0;
          else if (ifnet.if_lastchange.tv_sec < starttime.tv_sec)
              long_return = 0;
          else {
              long_return = (u_long)
                  ((ifnet.if_lastchange.tv_sec - starttime.tv_sec) * 100
 -                 + (ifnet.if_lastchange.tv_usec -
 +                 + (ifnet.if_lastchange.tv_nsec / 1000 -
                      starttime.tv_usec) / 10000);
          }
  #else
 


Home | Main Index | Thread Index | Old Index