@@ -32006,7 +32006,7 @@ index 4e97337811..bb8d8f9590 100644
32006
32006
sin(pi*x), giving accurate results for all finite x (especially x
32007
32007
integral or close to an integer). This is here for use in the
32008
32008
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
32009
- index 850769fd95..4e8c32c4fd 100644
32009
+ index 850769fd95..1933cf9a5b 100644
32010
32010
--- a/Modules/posixmodule.c
32011
32011
+++ b/Modules/posixmodule.c
32012
32012
@@ -20,6 +20,8 @@
@@ -32044,7 +32044,62 @@ index 850769fd95..4e8c32c4fd 100644
32044
32044
32045
32045
/*[clinic input]
32046
32046
# 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 @@
32048
32103
*/
32049
32104
#include <crt_externs.h>
32050
32105
#elif !defined(_MSC_VER) && (!defined(__WATCOMC__) || defined(__QNX__) || defined(__VXWORKS__))
@@ -32054,7 +32109,7 @@ index 850769fd95..4e8c32c4fd 100644
32054
32109
#endif /* !_MSC_VER */
32055
32110
32056
32111
static PyObject *
32057
- @@ -4348,7 +4371 ,12 @@
32112
+ @@ -4348,7 +4377 ,12 @@
32058
32113
}
32059
32114
32060
32115
Py_BEGIN_ALLOW_THREADS
@@ -32067,7 +32122,7 @@ index 850769fd95..4e8c32c4fd 100644
32067
32122
Py_END_ALLOW_THREADS
32068
32123
return result;
32069
32124
}
32070
- @@ -4625,7 +4653 ,7 @@
32125
+ @@ -4625,7 +4659 ,7 @@
32071
32126
static int
32072
32127
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
32073
32128
{
@@ -32076,7 +32131,7 @@ index 850769fd95..4e8c32c4fd 100644
32076
32131
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
32077
32132
UTIME_TO_TIMESPEC;
32078
32133
return utimensat(dir_fd, path, time, flags);
32079
- @@ -4651,7 +4679 ,7 @@
32134
+ @@ -4651,7 +4685 ,7 @@
32080
32135
static int
32081
32136
utime_fd(utime_t *ut, int fd)
32082
32137
{
@@ -32085,7 +32140,7 @@ index 850769fd95..4e8c32c4fd 100644
32085
32140
UTIME_TO_TIMESPEC;
32086
32141
return futimens(fd, time);
32087
32142
#else
32088
- @@ -4674,7 +4702 ,7 @@
32143
+ @@ -4674,7 +4708 ,7 @@
32089
32144
static int
32090
32145
utime_nofollow_symlinks(utime_t *ut, const char *path)
32091
32146
{
@@ -32094,7 +32149,7 @@ index 850769fd95..4e8c32c4fd 100644
32094
32149
UTIME_TO_TIMESPEC;
32095
32150
return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
32096
32151
#else
32097
- @@ -4690,7 +4718 ,7 @@
32152
+ @@ -4690,7 +4724 ,7 @@
32098
32153
static int
32099
32154
utime_default(utime_t *ut, const char *path)
32100
32155
{
0 commit comments