calling clearenv() only if it's avaialble

This commit is contained in:
2020-05-23 06:44:19 +00:00
parent 0623260ec4
commit bdd6d55e99
3 changed files with 6 additions and 2 deletions

View File

@ -1277,7 +1277,11 @@ static int cgi_peer_on_fork (mio_dev_pro_t* pro, void* fork_ctx)
path = getenv("PATH");
lang = getenv("LANG");
#if defined(HAVE_CLEARENV)
clearenv ();
#else
putenv ("environ=NULL");
#endif
if (path) setenv ("PATH", path, 1);
if (lang) setenv ("LANG", lang, 1);