From a2f032eb74882634afdf9d7f8617f7c375f18412 Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 29 Apr 2006 12:06:37 +0000 Subject: [PATCH] Fixed a bug with using `modf': I accidentally switched the arguments.. --- src/oping.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.30.2