summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2009-07-19 04:11:27 +0000
committerroot <root>2009-07-19 04:11:27 +0000
commit08f0ee3c6c197a7f4dc506cdc8e700a6536ee616 (patch)
tree3ac27a62a0c0dc72110af5df1a0b5fdf727b9fc8
parent44e7261c51583f351206cd5dbd02655ea5f4797d (diff)
*** empty log message ***
-rw-r--r--Changes2
-rw-r--r--ev_epoll.c9
-rw-r--r--ev_kqueue.c2
-rw-r--r--ev_poll.c2
-rw-r--r--ev_port.c2
5 files changed, 12 insertions, 5 deletions
diff --git a/Changes b/Changes
index e667d40..5a2ecbd 100644
--- a/Changes
+++ b/Changes
@@ -12,6 +12,8 @@ TODO: nsig
- take advantage of signalfd on GNU/Linux systems.
- document that the signal mask might be in an unspecified
state when using libev's signal handling.
+ - take advantage of some GNU/Linux calls to set cloexec/nonblock
+ on fd creation, to avoid race conditions.
3.7 Fri Jul 17 16:36:32 CEST 2009
- ev_unloop and ev_loop wrongly used a global variable to exit loops,
diff --git a/ev_epoll.c b/ev_epoll.c
index 40c320a..c4f1679 100644
--- a/ev_epoll.c
+++ b/ev_epoll.c
@@ -1,7 +1,7 @@
/*
* libev epoll fd activity backend
*
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
@@ -181,7 +181,12 @@ epoll_poll (EV_P_ ev_tstamp timeout)
int inline_size
epoll_init (EV_P_ int flags)
{
- backend_fd = epoll_create (256);
+#ifdef EPOLL_CLOEXEC
+ backend_fd = epoll_create1 (EPOLL_CLOEXEC);
+
+ if (backend_fd <= 0)
+#endif
+ backend_fd = epoll_create (256);
if (backend_fd < 0)
return 0;
diff --git a/ev_kqueue.c b/ev_kqueue.c
index c5f4eb7..0fe340b 100644
--- a/ev_kqueue.c
+++ b/ev_kqueue.c
@@ -1,7 +1,7 @@
/*
* libev kqueue backend
*
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
diff --git a/ev_poll.c b/ev_poll.c
index c33ea02..178e458 100644
--- a/ev_poll.c
+++ b/ev_poll.c
@@ -1,7 +1,7 @@
/*
* libev poll fd activity backend
*
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
diff --git a/ev_port.c b/ev_port.c
index 16fe86e..c000898 100644
--- a/ev_port.c
+++ b/ev_port.c
@@ -1,7 +1,7 @@
/*
* libev solaris event port backend
*
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
+ * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-