fixed to clear environment variables when clearenv() is not available

This commit is contained in:
hyung-hwan 2020-05-24 02:35:13 +00:00
parent bc9d849b8a
commit 8f7dcbe479

View File

@ -1282,7 +1282,10 @@ static int cgi_peer_on_fork (mio_dev_pro_t* pro, void* fork_ctx)
#if defined(HAVE_CLEARENV)
clearenv ();
#else
putenv ("environ=NULL");
{
extern char** environ;
if (environ) environ[0] = '\0';
}
#endif
if (path) setenv ("PATH", path, 1);
if (lang) setenv ("LANG", lang, 1);