client/rhel/rhnsd/rhnsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 639ecfa0262fdae2fa53bc21dee7c0c0a0f470b4
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jul 26 18:39:15 2011 +0200
679054 - fix random interval part
make sure to change time by adding seconds: time_t + int
in case of time_t + float, the result is unpredictable
diff --git a/client/rhel/rhnsd/rhnsd.c b/client/rhel/rhnsd/rhnsd.c
index 682085e..7c6711b 100644
--- a/client/rhel/rhnsd/rhnsd.c
+++ b/client/rhel/rhnsd/rhnsd.c
@@ -183,7 +183,7 @@ int main (int argc, char **argv)
if (pass_count % 12 == 0) {
/* end up with the next sleep being +/- 1/2 interval from last
* sleep time */
- sleep_until += 1.0 * (rand() - RAND_MAX/2.0) * interval * 60.0 / (RAND_MAX * 1.0);
+ sleep_until += (int)(1.0 * (rand() - RAND_MAX/2.0) * interval * 60.0 / (RAND_MAX *
1.0));
}
/* sleep_until could be within one minute of now, thanks to
Show replies by date