From d6e3e1cbbe1c46215da83edf2a8719064c74711a Mon Sep 17 00:00:00 2001 From: Joah Date: Tue, 20 Nov 2012 03:15:54 -0500 Subject: [PATCH] Port OpenVZ/epoll Fix From charybdis Ported the epoll fix to allow ShadowIRCd to work on OpenVZ VPSes from atheme/charybdis. --- libratbox/src/epoll.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libratbox/src/epoll.c b/libratbox/src/epoll.c index 6ec3b18..b6c4e28 100644 --- a/libratbox/src/epoll.c +++ b/libratbox/src/epoll.c @@ -253,6 +253,7 @@ rb_epoll_supports_event(void) /* try to detect at runtime if everything we need actually works */ timer_t timer; struct sigevent ev; + struct stat st; int fd; sigset_t set; @@ -261,6 +262,13 @@ rb_epoll_supports_event(void) if(can_do_event == -1) return 0; + /* Check for openvz..it has a broken timerfd.. */ + if(stat("/proc/user_beancounters", &st) == 0) + { + can_do_event = -1; + return 0; + } + #ifdef USE_TIMERFD_CREATE if((fd = timerfd_create(CLOCK_REALTIME, 0)) >= 0) {