aboutsummaryrefslogtreecommitdiff
path: root/networking/ntpd_simple.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-03-05 18:58:15 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-03-05 18:58:15 +0100
commit0ed5f7aacd5e412d80524a1fc7f90b55f470827b (patch)
treebf29230c0efc135ee707dc847da43a7afb743dad /networking/ntpd_simple.c
parent2cdcb1082c3de109eef564795feb5e8a368a88cf (diff)
downloadbusybox-w32-0ed5f7aacd5e412d80524a1fc7f90b55f470827b.tar.gz
busybox-w32-0ed5f7aacd5e412d80524a1fc7f90b55f470827b.tar.bz2
busybox-w32-0ed5f7aacd5e412d80524a1fc7f90b55f470827b.zip
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 <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ntpd_simple.c')
-rw-r--r--networking/ntpd_simple.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
index 22e899cb6..2cfbd55d4 100644
--- a/networking/ntpd_simple.c
+++ b/networking/ntpd_simple.c
@@ -248,7 +248,7 @@ error_interval(void)
248{ 248{
249 unsigned interval, r; 249 unsigned interval, r;
250 interval = INTERVAL_QUERY_PATHETIC * QSCALE_OFF_MAX / QSCALE_OFF_MIN; 250 interval = INTERVAL_QUERY_PATHETIC * QSCALE_OFF_MAX / QSCALE_OFF_MIN;
251 r = (unsigned)random() % (unsigned)(interval / 10); 251 r = (unsigned)rand() % (unsigned)(interval / 10);
252 return (interval + r); 252 return (interval + r);
253} 253}
254 254
@@ -326,8 +326,8 @@ send_query_to_peer(peer_t *p)
326 * 326 *
327 * Save the real transmit timestamp locally. 327 * Save the real transmit timestamp locally.
328 */ 328 */
329 p->p_xmt_msg.m_xmttime.int_partl = random(); 329 p->p_xmt_msg.m_xmttime.int_partl = rand();
330 p->p_xmt_msg.m_xmttime.fractionl = random(); 330 p->p_xmt_msg.m_xmttime.fractionl = rand();
331 p->p_xmttime = gettime1900d(); 331 p->p_xmttime = gettime1900d();
332 332
333 if (do_sendto(p->p_fd, /*from:*/ NULL, /*to:*/ &p->p_lsa->u.sa, /*addrlen:*/ p->p_lsa->len, 333 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)
531{ 531{
532 unsigned interval, r; 532 unsigned interval, r;
533 interval = requested * G.scale; 533 interval = requested * G.scale;
534 r = (unsigned)random() % (unsigned)(MAX(5, interval / 10)); 534 r = (unsigned)rand() % (unsigned)(MAX(5, interval / 10));
535 return (interval + r); 535 return (interval + r);
536} 536}
537static void 537static void
@@ -825,7 +825,7 @@ static NOINLINE void ntp_init(char **argv)
825 unsigned opts; 825 unsigned opts;
826 llist_t *peers; 826 llist_t *peers;
827 827
828 srandom(getpid()); 828 srand(getpid());
829 829
830 if (getuid()) 830 if (getuid())
831 bb_error_msg_and_die(bb_msg_you_must_be_root); 831 bb_error_msg_and_die(bb_msg_you_must_be_root);