author | Sebastian Harl <sh@tokkee.org> | |
Tue, 3 Feb 2009 12:05:21 +0000 (13:05 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 5 Feb 2009 20:10:26 +0000 (21:10 +0100) | ||
commit | a28ebbb8265605a09f0555d1eb036f50b9a784c8 | |
tree | e9c2eb062fac881f051621b7ef0784587d2c67e2 | tree | snapshot |
parent | 61c19cc11f325017d0186e9c345b6b4f01a4dc72 | commit | diff |
Converted timeval_sub_timespec() to timeval_cmp().
The third (return) argument is now of type 'struct timeval' (instead of
'struct timespec') as well. Also, it may now be NULL, in which case the
difference is not returned. This is a more general and thus more flexible
approach that permitted to remove the custom timeval_sub*() implementations in
the multimeter and ntpd plugins.
The return value has been changed to reflect the return value used by
functions like strcmp(), i.e. it is less than, equal to, or greater than zero
if the first argument is less than, equal to, or greater than the second
argument respectively.
In the cases where a 'struct timespec' is required, the return value is now
converted by multiplying the tv_usec member with 1000.
The third (return) argument is now of type 'struct timeval' (instead of
'struct timespec') as well. Also, it may now be NULL, in which case the
difference is not returned. This is a more general and thus more flexible
approach that permitted to remove the custom timeval_sub*() implementations in
the multimeter and ntpd plugins.
The return value has been changed to reflect the return value used by
functions like strcmp(), i.e. it is less than, equal to, or greater than zero
if the first argument is less than, equal to, or greater than the second
argument respectively.
In the cases where a 'struct timespec' is required, the return value is now
converted by multiplying the tv_usec member with 1000.
src/collectd.c | diff | blob | history | |
src/common.c | diff | blob | history | |
src/common.h | diff | blob | history | |
src/multimeter.c | diff | blob | history | |
src/ntpd.c | diff | blob | history | |
src/rrdtool.c | diff | blob | history |