tmux: Generalize patch for upstream inclusion
This commit is contained in:
parent
a236799e73
commit
1e9be3fc14
@ -1,12 +1,18 @@
|
|||||||
diff -u -r ../tmux-2.4/compat/imsg.c ./compat/imsg.c
|
diff -u -r ../tmux-3.1b/compat/imsg.c ./compat/imsg.c
|
||||||
--- ../tmux-2.4/compat/imsg.c 2017-04-19 14:49:29.000000000 +0200
|
--- ../tmux-3.1b/compat/imsg.c 2020-05-04 08:06:57.000000000 +0000
|
||||||
+++ ./compat/imsg.c 2017-04-22 02:21:48.592932564 +0200
|
+++ ./compat/imsg.c 2020-10-02 18:37:55.651051000 +0000
|
||||||
@@ -73,7 +73,7 @@
|
@@ -73,7 +73,13 @@
|
||||||
again:
|
again:
|
||||||
if (getdtablecount() + imsg_fd_overhead +
|
if (getdtablecount() + imsg_fd_overhead +
|
||||||
(int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int))
|
(int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int))
|
||||||
- >= getdtablesize()) {
|
- >= getdtablesize()) {
|
||||||
+ >= sysconf(_SC_OPEN_MAX)) {
|
+ >=
|
||||||
|
+#ifdef HAVE_SYSCONF
|
||||||
|
+ sysconf(_SC_OPEN_MAX)
|
||||||
|
+#else
|
||||||
|
+ getdtablesize()
|
||||||
|
+#endif
|
||||||
|
+ ) {
|
||||||
errno = EAGAIN;
|
errno = EAGAIN;
|
||||||
free(ifd);
|
free(ifd);
|
||||||
return (-1);
|
return (-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user