X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;fp=src%2Fnet_setup.c;h=dd6c58f1485608bd499d4e57ff5d54ee1cce1f7d;hp=b88f52625374e27505e043ca7fbdfbbf4c7fbbb1;hb=28be4baae016a5a771d0d9ec6e97ef38a4fc9e46;hpb=5d68458beed944d29d6da1bf82b311a5f3599119 diff --git a/src/net_setup.c b/src/net_setup.c index b88f5262..dd6c58f1 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -1086,11 +1086,13 @@ static bool setup_myself(void) { /* Open sockets */ - if(!do_detach && getenv("LISTEN_FDS")) { + const char *listen_fds = getenv("LISTEN_FDS"); + + if(!do_detach && listen_fds) { sockaddr_t sa; socklen_t salen; - listen_sockets = atoi(getenv("LISTEN_FDS")); + listen_sockets = atoi(listen_fds); #ifdef HAVE_UNSETENV unsetenv("LISTEN_FDS"); #endif