Skip to content

Commit

Permalink
ubuntu: Seed the RNG on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
rojer committed Sep 14, 2021
1 parent 9dd150c commit 4c375c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platforms/ubuntu/src/ubuntu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
*/

#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

#include "common/queue.h"

Expand Down Expand Up @@ -235,5 +238,7 @@ enum mgos_init_result mongoose_init(void) {

mgos_invoke_cb(ubuntu_net_up, NULL, false /* from_isr */);

srand(time(NULL) + getpid());

return mgos_init();
}

0 comments on commit 4c375c0

Please sign in to comment.