Dolda2000 GitWeb
/
ashd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
etc: Added a commented-out section for using FCGI PHP.
[ashd.git]
/
lib
/
mtio-epoll.c
diff --git
a/lib/mtio-epoll.c
b/lib/mtio-epoll.c
index
940ba3d
..
85ee4a1
100644
(file)
--- a/
lib/mtio-epoll.c
+++ b/
lib/mtio-epoll.c
@@
-17,6
+17,9
@@
*/
#include <stdlib.h>
*/
#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include <fcntl.h>
#include <string.h>
#include <sys/epoll.h>
#include <errno.h>
#include <string.h>
#include <sys/epoll.h>
#include <errno.h>
@@
-163,6
+166,7
@@
void ioloop(void)
time_t now, timeout;
epfd = epoll_create(128);
time_t now, timeout;
epfd = epoll_create(128);
+ fcntl(epfd, F_SETFD, FD_CLOEXEC);
for(bl = blockers; bl; bl = nbl) {
nbl = bl->n;
if(regfd(bl))
for(bl = blockers; bl; bl = nbl) {
nbl = bl->n;
if(regfd(bl))
@@
-184,7
+188,7
@@
void ioloop(void)
nev = epoll_wait(epfd, evr, sizeof(evr) / sizeof(*evr), toval);
if(nev < 0) {
if(errno != EINTR) {
nev = epoll_wait(epfd, evr, sizeof(evr) / sizeof(*evr), toval);
if(nev < 0) {
if(errno != EINTR) {
- flog(LOG_CRIT, "ioloop:
selec
t errored out: %s", strerror(errno));
+ flog(LOG_CRIT, "ioloop:
epoll_wai
t errored out: %s", strerror(errno));
/* To avoid CPU hogging in case it's bad, which it
* probably is. */
sleep(1);
/* To avoid CPU hogging in case it's bad, which it
* probably is. */
sleep(1);