Fix tmux not starting on an IPv6 only system.

Note that tmux will still not work if you have neither v4 nor v6.

PR:		203720
Obtained from:	https://github.com/tmux/tmux/issues/139
Sponsored by:	Absolight
This commit is contained in:
Mathieu Arnold 2015-10-14 13:55:06 +00:00
parent 9783336c86
commit a11d6f45c6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=399264
2 changed files with 18 additions and 1 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= tmux
PORTVERSION= 2.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= https://github.com/tmux/tmux/releases/download/${PORTVERSION}/ \
SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION:S/a$//}

View file

@ -0,0 +1,17 @@
--- compat/imsg.c.orig 2015-10-14 13:20:40 UTC
+++ compat/imsg.c
@@ -54,8 +54,12 @@ available_fds(unsigned int n)
for (i = 0; i < n; i++) {
fds[i] = -1;
if ((fds[i] = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- ret = 1;
- break;
+ if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
+ fds[i] = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (fds[i] < 0) {
+ ret = 1;
+ break;
+ }
}
}