[Libreoffice-commits] core.git: external/python3

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 2 07:49:24 UTC 2020


 external/python3/macos-11.patch.0 |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit ff270d936d1d0209d9036aaa9149a8ee489aaebf
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Dec 1 21:36:05 2020 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Dec 2 08:44:08 2020 +0100

    Guard against sysconf(_SC_OPEN_MAX) returning LONG_MAX
    
    That seems to happen in a sandboxed process on macOS, at least. This
    caused an apparent hang when invoking Python, for instance simply
    through Tools > Macros > Run Macro... .
    
    Change-Id: I6bc055b44f298251ed596084538b98442c215fce
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107013
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0
index 23fc5f9760c5..3c42d515f6bd 100644
--- a/external/python3/macos-11.patch.0
+++ b/external/python3/macos-11.patch.0
@@ -48,3 +48,23 @@
    #else
      #error "unknown architecture for universal build."
    #endif
+--- Modules/_posixsubprocess.c
++++ Modules/_posixsubprocess.c
+@@ -31,6 +31,8 @@
+ # define SYS_getdents64  __NR_getdents64
+ #endif
+ 
++#include <limits.h>
++
+ #if defined(__sun) && defined(__SVR4)
+ /* readdir64 is used to work around Solaris 9 bug 6395699. */
+ # define readdir readdir64
+@@ -202,7 +202,7 @@
+ #endif
+ #ifdef _SC_OPEN_MAX
+     local_max_fd = sysconf(_SC_OPEN_MAX);
+-    if (local_max_fd == -1)
++    if (local_max_fd == -1 || local_max_fd == LONG_MAX)
+ #endif
+         local_max_fd = 256;  /* Matches legacy Lib/subprocess.py behavior. */
+     return local_max_fd;


More information about the Libreoffice-commits mailing list