fixed a glitch in a http sample

This commit is contained in:
hyung-hwan 2012-05-01 15:38:01 +00:00
parent 238cc4d82e
commit efdb33cd30

View File

@ -574,7 +574,7 @@ static void* mux_open (qse_httpd_t* httpd)
memset (mux, 0, QSE_SIZEOF(*mux)); memset (mux, 0, QSE_SIZEOF(*mux));
#if defined(HAVE_EPOLL_CREATE1) #if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
mux->fd = epoll_create1 (O_CLOEXEC); mux->fd = epoll_create1 (O_CLOEXEC);
#else #else
mux->fd = epoll_create (100); mux->fd = epoll_create (100);
@ -586,11 +586,13 @@ static void* mux_open (qse_httpd_t* httpd)
return QSE_NULL; return QSE_NULL;
} }
#if defined(HAVE_EPOLL_CREATE1) #if defined(HAVE_EPOLL_CREATE1) && defined(O_CLOEXEC)
/* nothing else to do */ /* nothing else to do */
#else #else
flag = fcntl (mux->fd, F_GETFD); {
if (flag >= 0) fcntl (mux->fd, F_SETFD, flag | FD_CLOEXEC); int flag = fcntl (mux->fd, F_GETFD);
if (flag >= 0) fcntl (mux->fd, F_SETFD, flag | FD_CLOEXEC);
}
#endif #endif
return mux; return mux;