Commit 41eaf51c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use gettime instead of gettimeofday.

parent 17de0b62
...@@ -347,7 +347,7 @@ main(int argc, char **argv) ...@@ -347,7 +347,7 @@ main(int argc, char **argv)
exit(1); exit(1);
} }
gettimeofday(&now, NULL); gettime(&now);
rfd = open("/dev/urandom", O_RDONLY); rfd = open("/dev/urandom", O_RDONLY);
if(rfd < 0) { if(rfd < 0) {
...@@ -520,7 +520,7 @@ main(int argc, char **argv) ...@@ -520,7 +520,7 @@ main(int argc, char **argv)
continue; continue;
/* Apply jitter before we send the first message. */ /* Apply jitter before we send the first message. */
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL); gettime(&now);
send_hello(net); send_hello(net);
send_self_update(net, 0); send_self_update(net, 0);
send_request(net, NULL, 0, 0, 0, 0); send_request(net, NULL, 0, 0, 0, 0);
...@@ -534,7 +534,7 @@ main(int argc, char **argv) ...@@ -534,7 +534,7 @@ main(int argc, char **argv)
struct timeval tv; struct timeval tv;
fd_set readfds; fd_set readfds;
gettimeofday(&now, NULL); gettime(&now);
tv = check_neighbours_timeout; tv = check_neighbours_timeout;
timeval_min_sec(&tv, expiry_time); timeval_min_sec(&tv, expiry_time);
...@@ -574,7 +574,7 @@ main(int argc, char **argv) ...@@ -574,7 +574,7 @@ main(int argc, char **argv)
} }
} }
gettimeofday(&now, NULL); gettime(&now);
if(exiting) if(exiting)
break; break;
...@@ -699,7 +699,7 @@ main(int argc, char **argv) ...@@ -699,7 +699,7 @@ main(int argc, char **argv)
debugf("Exiting...\n"); debugf("Exiting...\n");
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL); gettime(&now);
/* Uninstall and retract all routes. */ /* Uninstall and retract all routes. */
while(numroutes > 0) { while(numroutes > 0) {
...@@ -726,7 +726,7 @@ main(int argc, char **argv) ...@@ -726,7 +726,7 @@ main(int argc, char **argv)
send_hello_noupdate(net, 10); send_hello_noupdate(net, 10);
flushbuf(net); flushbuf(net);
usleep(500 + random() % 1000); usleep(500 + random() % 1000);
gettimeofday(&now, NULL); gettime(&now);
} }
FOR_ALL_NETS(net) { FOR_ALL_NETS(net) {
if(!net->up) if(!net->up)
...@@ -735,7 +735,7 @@ main(int argc, char **argv) ...@@ -735,7 +735,7 @@ main(int argc, char **argv)
send_hello_noupdate(net, 1); send_hello_noupdate(net, 1);
flushbuf(net); flushbuf(net);
usleep(5000 + random() % 10000); usleep(5000 + random() % 10000);
gettimeofday(&now, NULL); gettime(&now);
network_up(net, 0); network_up(net, 0);
} }
kernel_setup_socket(0); kernel_setup_socket(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment