From 0ed5f7aacd5e412d80524a1fc7f90b55f470827b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 5 Mar 2014 18:58:15 +0100 Subject: use [s]rand(), not [s]random() rand() is the most standard C library function, and on uclibc they are the same. I guess they are the same in most todays' libc... Signed-off-by: Denys Vlasenko --- networking/ntpd_simple.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'networking/ntpd_simple.c') diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c index 22e899c..2cfbd55 100644 --- a/networking/ntpd_simple.c +++ b/networking/ntpd_simple.c @@ -248,7 +248,7 @@ error_interval(void) { unsigned interval, r; interval = INTERVAL_QUERY_PATHETIC * QSCALE_OFF_MAX / QSCALE_OFF_MIN; - r = (unsigned)random() % (unsigned)(interval / 10); + r = (unsigned)rand() % (unsigned)(interval / 10); return (interval + r); } @@ -326,8 +326,8 @@ send_query_to_peer(peer_t *p) * * Save the real transmit timestamp locally. */ - p->p_xmt_msg.m_xmttime.int_partl = random(); - p->p_xmt_msg.m_xmttime.fractionl = random(); + p->p_xmt_msg.m_xmttime.int_partl = rand(); + p->p_xmt_msg.m_xmttime.fractionl = rand(); p->p_xmttime = gettime1900d(); if (do_sendto(p->p_fd, /*from:*/ NULL, /*to:*/ &p->p_lsa->u.sa, /*addrlen:*/ p->p_lsa->len, @@ -531,7 +531,7 @@ scale_interval(unsigned requested) { unsigned interval, r; interval = requested * G.scale; - r = (unsigned)random() % (unsigned)(MAX(5, interval / 10)); + r = (unsigned)rand() % (unsigned)(MAX(5, interval / 10)); return (interval + r); } static void @@ -825,7 +825,7 @@ static NOINLINE void ntp_init(char **argv) unsigned opts; llist_t *peers; - srandom(getpid()); + srand(getpid()); if (getuid()) bb_error_msg_and_die(bb_msg_you_must_be_root); -- cgit v1.1