Avoid calling time(NULL).
[tinc] / src / tincd.c
index 8412c8f..333a207 100644 (file)
@@ -346,7 +346,8 @@ int main(int argc, char **argv) {
 
        /* Slllluuuuuuurrrrp! */
 
-       srand(time(NULL));
+       gettimeofday(&now, NULL);
+       srand(now.tv_sec + now.tv_usec);
        crypto_init();
 
        if(!read_server_config())