]> jfr.im git - irc/blitzed-org/charybdis.git/commitdiff
Disable timerfd/signalfd on openvz, it seems broken
authorAaron Sethman <redacted>
Sat, 19 May 2012 02:15:16 +0000 (21:15 -0500)
committerJilles Tjoelker <redacted>
Thu, 5 Jul 2012 21:55:22 +0000 (23:55 +0200)
(imported from libratbox r27395 by nenolod)
(cherry picked from commit 21acd0961cd856c1033fe3875159875ad981ddf2)

libratbox/src/epoll.c

index 9409cadce4e2364c39830312a590fb8055afd02f..480ceed0814888bedeadcf0bd85fa3d7c95f2af2 100644 (file)
@@ -254,6 +254,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;
 
@@ -262,6 +263,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)
        {