# HG changeset patch # User Roy Marples # Date 1590331086 0 # Node ID a96dc3692fce9200e609f00b5cafc857e9722e6f # Parent 95976721c27ddd059aee4979171c291d41c37586 privsep: root and inet don't need arc4random Saves a fd or two. diff -r 95976721c27d -r a96dc3692fce src/privsep.c --- a/src/privsep.c Sun May 24 14:49:41 2020 +0100 +++ b/src/privsep.c Sun May 24 14:38:06 2020 +0000 @@ -321,12 +321,6 @@ TAILQ_INIT(&ctx->ps_processes); -#ifdef ARC4RANDOM_H - /* Seed the random number generator early incase it needs /dev/urandom - * which won't be available in the chroot. */ - arc4random(); -#endif - switch (pid = ps_root_start(ctx)) { case -1: logerr("ps_root_start"); @@ -354,6 +348,13 @@ } started: + +#ifdef ARC4RANDOM_H + /* Seed the random number generator early incase it needs /dev/urandom + * which won't be available in the chroot. */ + arc4random(); +#endif + return 1; }