summaryrefslogtreecommitdiffstats
path: root/osdep-linux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2010-12-30 20:41:08 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2010-12-30 20:41:08 +0000
commit436f3b357ee6a960621c319b7904aeed1cccead4 (patch)
treed5ef34bc8cc43d81c3582645b61724ca2200df47 /osdep-linux.c
parentba89a048edeebb34f03a46b5ecc789655f7d223d (diff)
epoll on Linux is broken with /dev/null so it needs to be disabled.
Instead of adding another BROKEN_* define, move event_init into osdep-*.c.
Diffstat (limited to 'osdep-linux.c')
-rw-r--r--osdep-linux.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/osdep-linux.c b/osdep-linux.c
index c85beb28..e3fe277d 100644
--- a/osdep-linux.c
+++ b/osdep-linux.c
@@ -1,4 +1,4 @@
-/* $Id: osdep-linux.c,v 1.6 2009-04-29 23:07:35 nicm Exp $ */
+/* $Id: osdep-linux.c,v 1.7 2010-12-30 20:41:08 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -19,7 +19,9 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <event.h>
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include "tmux.h"
@@ -57,3 +59,13 @@ osdep_get_name(int fd, unused char *tty)
fclose(f);
return (buf);
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ /*
+ * On Linux, epoll doesn't work on /dev/null (yes, really).
+ */
+ setenv("EVENT_NOEPOLL", "1", 1);
+ return (event_init());
+}