]> tinc-vpn.org Git - tinc/blobdiff - src/tincd.c
tincd on Windows: call srand() after main2()
[tinc] / src / tincd.c
index dff420a477ec458c1b06073ebfa8cdeec7b485b4..560609c1bedaaad7454114fe8de72ca183a4b4b6 100644 (file)
@@ -491,8 +491,6 @@ int main(int argc, char **argv) {
 
        /* Slllluuuuuuurrrrp! */
 
 
        /* Slllluuuuuuurrrrp! */
 
-       gettimeofday(&now, NULL);
-       srand(now.tv_sec + now.tv_usec);
        crypto_init();
 
        if(!read_server_config(&config_tree)) {
        crypto_init();
 
        if(!read_server_config(&config_tree)) {
@@ -546,6 +544,9 @@ int main2(int argc, char **argv) {
 #endif
        char *priority = NULL;
 
 #endif
        char *priority = NULL;
 
+       gettimeofday(&now, NULL);
+       srand(now.tv_sec + now.tv_usec);
+
        if(!detach()) {
                return 1;
        }
        if(!detach()) {
                return 1;
        }