From 1e9be3fc146c59bfd82807bcff7087bc664ad134 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 2 Oct 2020 21:00:56 +0200 Subject: [PATCH] tmux: Generalize patch for upstream inclusion --- packages/tmux/compat-imsg.c.patch | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/tmux/compat-imsg.c.patch b/packages/tmux/compat-imsg.c.patch index 40c2a0991..97e814099 100644 --- a/packages/tmux/compat-imsg.c.patch +++ b/packages/tmux/compat-imsg.c.patch @@ -1,12 +1,18 @@ -diff -u -r ../tmux-2.4/compat/imsg.c ./compat/imsg.c ---- ../tmux-2.4/compat/imsg.c 2017-04-19 14:49:29.000000000 +0200 -+++ ./compat/imsg.c 2017-04-22 02:21:48.592932564 +0200 -@@ -73,7 +73,7 @@ +diff -u -r ../tmux-3.1b/compat/imsg.c ./compat/imsg.c +--- ../tmux-3.1b/compat/imsg.c 2020-05-04 08:06:57.000000000 +0000 ++++ ./compat/imsg.c 2020-10-02 18:37:55.651051000 +0000 +@@ -73,7 +73,13 @@ again: if (getdtablecount() + imsg_fd_overhead + (int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int)) - >= getdtablesize()) { -+ >= sysconf(_SC_OPEN_MAX)) { ++ >= ++#ifdef HAVE_SYSCONF ++ sysconf(_SC_OPEN_MAX) ++#else ++ getdtablesize() ++#endif ++ ) { errno = EAGAIN; free(ifd); return (-1);