From: octo Date: Sat, 29 Apr 2006 12:06:37 +0000 (+0000) Subject: Fixed a bug with using `modf': I accidentally switched the arguments.. X-Git-Tag: liboping-0.1.0~23 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a2f032eb74882634afdf9d7f8617f7c375f18412;p=collectd.git Fixed a bug with using `modf': I accidentally switched the arguments.. --- diff --git a/src/oping.c b/src/oping.c index c2dd2694..457a09d2 100644 --- a/src/oping.c +++ b/src/oping.c @@ -257,9 +257,11 @@ int main (int argc, char **argv) double temp_sec; double temp_nsec; - temp_sec = modf (opt_interval, &temp_nsec); + temp_nsec = modf (opt_interval, &temp_sec); ts_int.tv_sec = (time_t) temp_sec; ts_int.tv_nsec = (long) (temp_nsec * 1000000000L); + + /* printf ("ts_int = %i.%09li\n", (int) ts_int.tv_sec, ts_int.tv_nsec); */ } if (opt_addrfamily != PING_DEF_AF) @@ -330,6 +332,7 @@ int main (int argc, char **argv) time_calc (&ts_wait, &ts_int, &tv_begin, &tv_end); + /* printf ("Sleeping for %i.%09li seconds\n", (int) ts_wait.tv_sec, ts_wait.tv_nsec); */ while ((status = nanosleep (&ts_wait, &ts_wait)) != 0) { if (errno != EINTR)