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.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'networking/ntpd.c') diff --git a/networking/ntpd.c b/networking/ntpd.c index bf8ef0a89..44592ce54 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -827,8 +827,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(); /* Were doing it only if sendto worked, but @@ -1652,7 +1652,7 @@ retry_interval(void) /* Local problem, want to retry soon */ unsigned interval, r; interval = RETRY_INTERVAL; - r = random(); + r = rand(); interval += r % (unsigned)(RETRY_INTERVAL / 4); VERB4 bb_error_msg("chose retry interval:%u", interval); return interval; @@ -1666,7 +1666,7 @@ poll_interval(int exponent) exponent = 0; interval = 1 << exponent; mask = ((interval-1) >> 4) | 1; - r = random(); + r = rand(); interval += r & mask; /* ~ random(0..1) * interval/16 */ VERB4 bb_error_msg("chose poll interval:%u (poll_exp:%d exp:%d)", interval, G.poll_exp, exponent); return interval; @@ -2067,7 +2067,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.2.3