ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.55 by ats, Tue Mar 9 11:29:46 2004 UTC vs.
Revision 1.56 by ats, Tue Mar 9 12:43:41 2004 UTC

# Line 322 | Line 322 | network_stat_t *get_network_stats(int *entries){
322   }
323  
324   long long transfer_diff(long long new, long long old){
325 < #if defined(SOL7) || defined(LINUX) || defined(FREEBSD) || defined(DFBSD)
326 < #define MAXVAL 0xffffffffLL
325 > #if defined(SOL7) || defined(LINUX) || defined(FREEBSD) || defined(DFBSD) || defined(OPENBSD)
326 >        /* 32-bit quantities, so we must explicitly deal with wraparound. */
327 > #define MAXVAL 0x100000000LL
328 >        if (new >= old) {
329 >                return new - old;
330 >        } else {
331 >                return MAXVAL + new - old;
332 >        }
333   #else
334 < #define MAXVAL 0xffffffffffffffffLL
334 >        /* 64-bit quantities, so plain subtraction works. */
335 >        return new - old;
336   #endif
330        long long result;
331        if(new>=old){
332                result = (new-old);
333        }else{
334                result = (MAXVAL+(new-old));
335        }
336
337        return result;
338
337   }
338  
339   network_stat_t *get_network_stats_diff(int *entries) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines