Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4383
Modified Files:
configure osdep-darwin.c osdep-freebsd.c osdep-linux.c
osdep-netbsd.c osdep-openbsd.c osdep-sunos.c osdep-unknown.c
tmux.c tmux.h
Log Message:
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.
Index: osdep-linux.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-linux.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- osdep-linux.c 29 Apr 2009 23:07:35 -0000 1.6
+++ osdep-linux.c 30 Dec 2010 20:41:08 -0000 1.7
@@ -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 @@
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());
+}
Index: osdep-darwin.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-darwin.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- osdep-darwin.c 4 May 2009 17:58:27 -0000 1.11
+++ osdep-darwin.c 30 Dec 2010 20:41:07 -0000 1.12
@@ -19,11 +19,13 @@
#include <sys/types.h>
#include <sys/sysctl.h>
+#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-char *osdep_get_name(int, char *);
+char *osdep_get_name(int, char *);
+struct event_base *osdep_event_init(void);
#define unused __attribute__ ((unused))
@@ -31,7 +33,7 @@
osdep_get_name(int fd, unused char *tty)
{
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, 0 };
- size_t size;
+ size_t size;
struct kinfo_proc kp;
if ((mib[3] = tcgetpgrp(fd)) == -1)
@@ -45,3 +47,15 @@
return (strdup(kp.kp_proc.p_comm));
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ /*
+ * On OS X, kqueue and poll are both completely broken and don't
+ * work on anything except socket file descriptors (yes, really).
+ */
+ setenv("EVENT_NOKQUEUE", "1", 1);
+ setenv("EVENT_NOPOLL", "1", 1);
+ return (event_init());
+}
Index: osdep-unknown.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-unknown.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- osdep-unknown.c 29 Apr 2009 23:07:35 -0000 1.5
+++ osdep-unknown.c 30 Dec 2010 20:41:08 -0000 1.6
@@ -18,6 +18,8 @@
#include <sys/types.h>
+#include <event.h>
+
#include "tmux.h"
char *
@@ -25,3 +27,9 @@
{
return (NULL);
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ return (event_init());
+}
Index: osdep-freebsd.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-freebsd.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- osdep-freebsd.c 9 Aug 2009 18:00:45 -0000 1.19
+++ osdep-freebsd.c 30 Dec 2010 20:41:08 -0000 1.20
@@ -24,6 +24,7 @@
#include <err.h>
#include <errno.h>
+#include <event.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -31,6 +32,7 @@
struct kinfo_proc *cmp_procs(struct kinfo_proc *, struct kinfo_proc *);
char *osdep_get_name(int, char *);
+struct event_base *osdep_event_init(void);
#ifndef nitems
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
@@ -127,3 +129,14 @@
free(buf);
return (NULL);
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ /*
+ * On some versions of FreeBSD, kqueue doesn't work properly on tty
+ * file descriptors. This is fixed in recent FreeBSD versions.
+ */
+ setenv("EVENT_NOKQUEUE", "1", 1);
+ return (event_init());
+}
Index: tmux.c
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.c,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -d -r1.228 -r1.229
--- tmux.c 27 Dec 2010 21:22:24 -0000 1.228
+++ tmux.c 30 Dec 2010 20:41:08 -0000 1.229
@@ -495,20 +495,6 @@
#endif
/* Pass control to the client. */
-#ifdef HAVE_BROKEN_KQUEUE
- if (setenv("EVENT_NOKQUEUE", "1", 1) != 0)
- fatal("setenv failed");
-#endif
-#ifdef HAVE_BROKEN_POLL
- if (setenv("EVENT_NOPOLL", "1", 1) != 0)
- fatal("setenv failed");
-#endif
- ev_base = event_init();
-#ifdef HAVE_BROKEN_KQUEUE
- unsetenv("EVENT_NOKQUEUE");
-#endif
-#ifdef HAVE_BROKEN_POLL
- unsetenv("EVENT_NOPOLL");
-#endif
+ ev_base = osdep_event_init();
exit(client_main(argc, argv, flags));
}
Index: osdep-sunos.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-sunos.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- osdep-sunos.c 15 Oct 2009 07:11:25 -0000 1.2
+++ osdep-sunos.c 30 Dec 2010 20:41:08 -0000 1.3
@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <event.h>
#include <fcntl.h>
#include <procfs.h>
#include <stdio.h>
@@ -63,3 +64,9 @@
return (xstrdup(p.pr_fname));
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ return (event_init());
+}
Index: osdep-openbsd.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-openbsd.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- osdep-openbsd.c 26 Dec 2009 23:48:37 -0000 1.20
+++ osdep-openbsd.c 30 Dec 2010 20:41:08 -0000 1.21
@@ -21,6 +21,7 @@
#include <sys/stat.h>
#include <errno.h>
+#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -34,8 +35,10 @@
#define is_stopped(p) \
((p)->p_stat == SSTOP || (p)->p_stat == SZOMB || (p)->p_stat == SDEAD)
+
struct kinfo_proc2 *cmp_procs(struct kinfo_proc2 *, struct kinfo_proc2 *);
-char *osdep_get_name(int, char *);
+char *osdep_get_name(int, char *);
+struct event_base *osdep_event_init(void);
struct kinfo_proc2 *
cmp_procs(struct kinfo_proc2 *p1, struct kinfo_proc2 *p2)
@@ -130,3 +133,9 @@
free(buf);
return (NULL);
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ return (event_init());
+}
Index: osdep-netbsd.c
===================================================================
RCS file: /cvsroot/tmux/tmux/osdep-netbsd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- osdep-netbsd.c 24 Sep 2009 12:30:22 -0000 1.9
+++ osdep-netbsd.c 30 Dec 2010 20:41:08 -0000 1.10
@@ -22,6 +22,7 @@
#include <sys/sysctl.h>
#include <errno.h>
+#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -33,6 +34,7 @@
struct kinfo_proc2 *cmp_procs(struct kinfo_proc2 *, struct kinfo_proc2 *);
char *osdep_get_name(int, char *);
+struct event_base *osdep_event_init(void);
struct kinfo_proc2 *
cmp_procs(struct kinfo_proc2 *p1, struct kinfo_proc2 *p2)
@@ -120,3 +122,9 @@
free(buf);
return (NULL);
}
+
+struct event_base *
+osdep_event_init(void)
+{
+ return (event_init());
+}
Index: tmux.h
===================================================================
RCS file: /cvsroot/tmux/tmux/tmux.h,v
retrieving revision 1.591
retrieving revision 1.592
diff -u -d -r1.591 -r1.592
--- tmux.h 22 Dec 2010 15:36:44 -0000 1.591
+++ tmux.h 30 Dec 2010 20:41:08 -0000 1.592
@@ -2004,7 +2004,8 @@
int utf8_append(struct utf8_data *, u_char);
/* osdep-*.c */
-char *osdep_get_name(int, char *);
+char *osdep_get_name(int, char *);
+struct event_base *osdep_event_init(void);
/* log.c */
void log_open_tty(int);
Index: configure
===================================================================
RCS file: /cvsroot/tmux/tmux/configure,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- configure 8 Dec 2010 19:55:31 -0000 1.59
+++ configure 30 Dec 2010 20:41:07 -0000 1.60
@@ -30,8 +30,6 @@
#undef HAVE_ASPRINTF
#undef HAVE_BROKEN_CMSG_FIRSTHDR
#undef HAVE_BROKEN_CURSES_H
-#undef HAVE_BROKEN_KQUEUE
-#undef HAVE_BROKEN_POLL
#undef HAVE_BZERO
#undef HAVE_CLOSEFROM
#undef HAVE_DAEMON
@@ -185,8 +183,6 @@
cat <<EOF >>$CONFIG_H
#define HAVE_ASPRINTF
#define HAVE_BROKEN_CMSG_FIRSTHDR
-#define HAVE_BROKEN_KQUEUE
-#define HAVE_BROKEN_POLL
#define HAVE_BZERO
#define HAVE_DAEMON
#define HAVE_DIRFD
@@ -222,7 +218,6 @@
FreeBSD|DragonFly)
cat <<EOF >>$CONFIG_H
#define HAVE_ASPRINTF
-#define HAVE_BROKEN_KQUEUE
#define HAVE_BZERO
#define HAVE_CLOSEFROM
#define HAVE_DAEMON
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs