summaryrefslogtreecommitdiffstats
path: root/osdep-linux.c
authornicm <nicm>2010-12-30 20:41:07 (GMT)
committer nicm <nicm>2010-12-30 20:41:07 (GMT)
commit5ef16531ea9f4d397ce8d02a58d50b11ed7825b0 (patch) (side-by-side diff)
tree0ca6e97433518120d6bac3a393f7d199b4c7f00d /osdep-linux.c
parentc286a667a94ab4509863dc2882ad0bd381756010 (diff)
downloadtmux-old-5ef16531ea9f4d397ce8d02a58d50b11ed7825b0.zip
tmux-old-5ef16531ea9f4d397ce8d02a58d50b11ed7825b0.tar.gz
tmux-old-5ef16531ea9f4d397ce8d02a58d50b11ed7825b0.tar.bz2
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') (more/less context) (ignore whitespace changes)
-rw-r--r--osdep-linux.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/osdep-linux.c b/osdep-linux.c
index b7235a5..2525512 100644
--- a/osdep-linux.c
+++ b/osdep-linux.c
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id: osdep-linux.c,v 1.7 2010/12/30 20:41:08 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <[email protected]>
@@ -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());
+}