You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ge...@apache.org on 2010/03/26 16:56:03 UTC
svn commit: r927940 -
/incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
Author: georgep
Date: Fri Mar 26 15:56:03 2010
New Revision: 927940
URL: http://svn.apache.org/viewvc?rev=927940&view=rev
Log:
TS-263: patch '0001-TS263_patch1.diff.patch'. Better handling of eventfd() for kernels <= 2.6.26.
Modified:
incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
Modified: incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc?rev=927940&r1=927939&r2=927940&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc (original)
+++ incubator/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc Fri Mar 26 15:56:03 2010
@@ -66,8 +66,16 @@ EThread::EThread(ThreadType att, int ani
memset(thread_private, 0, PER_THREAD_DATA);
#ifdef HAVE_EVENTFD
evfd = eventfd(0, O_NONBLOCK | FD_CLOEXEC);
- if (evfd < 0)
- ink_release_assert((evfd = eventfd(0,0)) >= 0);
+ if (evfd < 0) {
+ if (errno == EINVAL) { // flags invalid for kernel <= 2.6.26
+ evfd = eventfd(0,0);
+ if (evfd < 0) {
+ Fatal("EThread::EThread: %d=eventfd(0,0),errno(%d)",evfd,errno);
+ }
+ } else {
+ Fatal("EThread::EThread: %d=eventfd(0,O_NONBLOCK | FD_CLOEXEC),errno(%d)",evfd,errno);
+ }
+ }
fcntl(evfd, F_SETFD, FD_CLOEXEC);
fcntl(evfd, F_SETFL, O_NONBLOCK);
#else