calling clearenv() only if it's avaialble

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

View File

@ -1135,7 +1135,7 @@ for (i = 0; i < 5; i++)
//mio_bcstrtoskad (mio, "[fe80::c7e2:bd6e:1209:ac1b%eno1]:1153", &servaddr);
//mio_bcstrtoskad (mio, "[::]:9988", &htts_bind_addr);
mio_bcstrtoskad (mio, "127.0.0.1:9988", &htts_bind_addr);
mio_bcstrtoskad (mio, "0.0.0.0:9988", &htts_bind_addr);
dnc = mio_svc_dnc_start(mio, &servaddr, MIO_NULL, &send_tmout, &reply_tmout, 2); /* option - send to all, send one by one */
htts = mio_svc_htts_start(mio, &htts_bind_addr, process_http_request);

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);

View File

@ -243,7 +243,7 @@ int mio_sys_waitmux (mio_t* mio, const mio_ntime_t* tmout, mio_sys_mux_evtcb_t e
dev = mux->pd.dptr[i];
MIO_ASSERT (mio, !(mux->pd.pfd[i].revents & POLLNVAL));
/*MIO_ASSERT (mio, !(mux->pd.pfd[i].revents & POLLNVAL));*/
if (mux->pd.pfd[i].revents & POLLIN) events |= MIO_DEV_EVENT_IN;
if (mux->pd.pfd[i].revents & POLLOUT) events |= MIO_DEV_EVENT_OUT;
if (mux->pd.pfd[i].revents & POLLPRI) events |= MIO_DEV_EVENT_PRI;