From: Mark Wooding Date: Sun, 13 May 2018 14:31:15 +0000 (+0100) Subject: server/tripe.c: Establish the stdio admin client early. X-Git-Tag: 1.5.0~27 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/acd781a81901f9785125ea2c4c99d5d0952eecdd server/tripe.c: Establish the stdio admin client early. This way, warnings from peer initialization, for example, are reported to the stdio admin client rather than stderr. --- diff --git a/server/tripe.c b/server/tripe.c index 60460598..aa225da7 100644 --- a/server/tripe.c +++ b/server/tripe.c @@ -292,10 +292,7 @@ int main(int argc, char *argv[]) rand_noisesrc(RAND_GLOBAL, &noise_source); rand_seed(RAND_GLOBAL, MAXHASHSZ); signal(SIGPIPE, SIG_IGN); - for (i = 0; tunnels[i]; i++) - tunnels[i]->init(); - p_init(); - p_bind(ailist); freeaddrinfo(ailist); + if (!(f & f_daemon)) { af = AF_WARN; #ifndef NTRACE @@ -307,6 +304,11 @@ int main(int argc, char *argv[]) a_switcherr(); } + p_init(); + for (i = 0; tunnels[i]; i++) + tunnels[i]->init(); + p_bind(ailist); freeaddrinfo(ailist); + for (i = 0; tunnels[i]; i++) { if (tunnels[i]->flags&TUNF_PRIVOPEN) { ps_split(f & f_daemon);