Skip to content

Commit 22d18bc

Browse files
committed
Refs #85 -- Corrected a problem with the 3.8 patch.
1 parent 1ecedf1 commit 22d18bc

File tree

2 files changed

+63
-7
lines changed

2 files changed

+63
-7
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ CFLAGS-macOS=-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
5252
TARGETS-iOS=iphonesimulator.x86_64 iphoneos.arm64
5353
CFLAGS-iOS=-mios-version-min=8.0
5454
CFLAGS-iphoneos.arm64=-fembed-bitcode
55+
CFLAGS-iphonesimulator.x86_64=-fembed-bitcode
5556

5657
# tvOS targets
5758
TARGETS-tvOS=appletvsimulator.x86_64 appletvos.arm64

patch/Python/Python.patch

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32006,7 +32006,7 @@ index 4e97337811..bb8d8f9590 100644
3200632006
sin(pi*x), giving accurate results for all finite x (especially x
3200732007
integral or close to an integer). This is here for use in the
3200832008
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
32009-
index 850769fd95..4e8c32c4fd 100644
32009+
index 850769fd95..1933cf9a5b 100644
3201032010
--- a/Modules/posixmodule.c
3201132011
+++ b/Modules/posixmodule.c
3201232012
@@ -20,6 +20,8 @@
@@ -32044,7 +32044,62 @@ index 850769fd95..4e8c32c4fd 100644
3204432044

3204532045
/*[clinic input]
3204632046
# one of the few times we lie about this name!
32047-
@@ -1373,7 +1394,9 @@
32047+
@@ -442,27 +463,33 @@
32048+
}
32049+
}
32050+
}
32051+
+#endif
32052+
32053+
void
32054+
PyOS_BeforeFork(void)
32055+
{
32056+
+#ifdef HAVE_FORK
32057+
run_at_forkers(_PyInterpreterState_Get()->before_forkers, 1);
32058+
32059+
_PyImport_AcquireLock();
32060+
+#endif
32061+
}
32062+
32063+
void
32064+
PyOS_AfterFork_Parent(void)
32065+
{
32066+
+#ifdef HAVE_FORK
32067+
if (_PyImport_ReleaseLock() <= 0)
32068+
Py_FatalError("failed releasing import lock after fork");
32069+
32070+
run_at_forkers(_PyInterpreterState_Get()->after_forkers_parent, 0);
32071+
+#endif
32072+
}
32073+
32074+
void
32075+
PyOS_AfterFork_Child(void)
32076+
{
32077+
+#ifdef HAVE_FORK
32078+
_PyRuntimeState *runtime = &_PyRuntime;
32079+
_PyGILState_Reinit(runtime);
32080+
_PyEval_ReInitThreads(runtime);
32081+
@@ -472,8 +499,10 @@
32082+
_PyInterpreterState_DeleteExceptMain(runtime);
32083+
32084+
run_at_forkers(_PyInterpreterState_Get()->after_forkers_child, 0);
32085+
+#endif
32086+
}
32087+
32088+
+#ifdef HAVE_FORK
32089+
static int
32090+
register_at_forker(PyObject **lst, PyObject *func)
32091+
{
32092+
@@ -492,9 +521,7 @@
32093+
void
32094+
PyOS_AfterFork(void)
32095+
{
32096+
-#ifdef HAVE_FORK
32097+
PyOS_AfterFork_Child();
32098+
-#endif
32099+
}
32100+
32101+
32102+
@@ -1373,7 +1400,9 @@
3204832103
*/
3204932104
#include <crt_externs.h>
3205032105
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
@@ -32054,7 +32109,7 @@ index 850769fd95..4e8c32c4fd 100644
3205432109
#endif /* !_MSC_VER */
3205532110

3205632111
static PyObject *
32057-
@@ -4348,7 +4371,12 @@
32112+
@@ -4348,7 +4377,12 @@
3205832113
}
3205932114

3206032115
Py_BEGIN_ALLOW_THREADS
@@ -32067,7 +32122,7 @@ index 850769fd95..4e8c32c4fd 100644
3206732122
Py_END_ALLOW_THREADS
3206832123
return result;
3206932124
}
32070-
@@ -4625,7 +4653,7 @@
32125+
@@ -4625,7 +4659,7 @@
3207132126
static int
3207232127
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
3207332128
{
@@ -32076,7 +32131,7 @@ index 850769fd95..4e8c32c4fd 100644
3207632131
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
3207732132
UTIME_TO_TIMESPEC;
3207832133
return utimensat(dir_fd, path, time, flags);
32079-
@@ -4651,7 +4679,7 @@
32134+
@@ -4651,7 +4685,7 @@
3208032135
static int
3208132136
utime_fd(utime_t *ut, int fd)
3208232137
{
@@ -32085,7 +32140,7 @@ index 850769fd95..4e8c32c4fd 100644
3208532140
UTIME_TO_TIMESPEC;
3208632141
return futimens(fd, time);
3208732142
#else
32088-
@@ -4674,7 +4702,7 @@
32143+
@@ -4674,7 +4708,7 @@
3208932144
static int
3209032145
utime_nofollow_symlinks(utime_t *ut, const char *path)
3209132146
{
@@ -32094,7 +32149,7 @@ index 850769fd95..4e8c32c4fd 100644
3209432149
UTIME_TO_TIMESPEC;
3209532150
return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
3209632151
#else
32097-
@@ -4690,7 +4718,7 @@
32152+
@@ -4690,7 +4724,7 @@
3209832153
static int
3209932154
utime_default(utime_t *ut, const char *path)
3210032155
{

0 commit comments

Comments
 (0)