@@ -32069,7 +32069,7 @@ index 8eedca8a30..ad70499c82 100644
32069
32069
PyFPE_START_PROTECT("in math_hypot", return 0);
32070
32070
r = hypot(x, y);
32071
32071
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
32072
- index 58cb9b0d46..4a2ae3f024 100644
32072
+ index 58cb9b0d46..d01aba8d6f 100644
32073
32073
--- a/Modules/posixmodule.c
32074
32074
+++ b/Modules/posixmodule.c
32075
32075
@@ -20,6 +20,8 @@
@@ -32105,7 +32105,61 @@ index 58cb9b0d46..4a2ae3f024 100644
32105
32105
32106
32106
/*[clinic input]
32107
32107
# one of the few times we lie about this name!
32108
- @@ -1309,7 +1328,9 @@
32108
+ @@ -429,35 +448,43 @@
32109
+ }
32110
+ }
32111
+ }
32112
+ +#endif
32113
+
32114
+ void
32115
+ PyOS_BeforeFork(void)
32116
+ {
32117
+ +#ifdef HAVE_FORK
32118
+ run_at_forkers(PyThreadState_Get()->interp->before_forkers, 1);
32119
+
32120
+ _PyImport_AcquireLock();
32121
+ +#endif
32122
+ }
32123
+
32124
+ void
32125
+ PyOS_AfterFork_Parent(void)
32126
+ {
32127
+ +#ifdef HAVE_FORK
32128
+ if (_PyImport_ReleaseLock() <= 0)
32129
+ Py_FatalError("failed releasing import lock after fork");
32130
+
32131
+ run_at_forkers(PyThreadState_Get()->interp->after_forkers_parent, 0);
32132
+ +#endif
32133
+ }
32134
+
32135
+ void
32136
+ PyOS_AfterFork_Child(void)
32137
+ {
32138
+ +#ifdef HAVE_FORK
32139
+ _PyGILState_Reinit();
32140
+ PyEval_ReInitThreads();
32141
+ _PyImport_ReInitLock();
32142
+ _PySignal_AfterFork();
32143
+
32144
+ run_at_forkers(PyThreadState_Get()->interp->after_forkers_child, 0);
32145
+ +#endif
32146
+ }
32147
+
32148
+ +#ifdef HAVE_FORK
32149
+ static int
32150
+ register_at_forker(PyObject **lst, PyObject *func)
32151
+ {
32152
+ @@ -476,9 +503,7 @@
32153
+ void
32154
+ PyOS_AfterFork(void)
32155
+ {
32156
+ -#ifdef HAVE_FORK
32157
+ PyOS_AfterFork_Child();
32158
+ -#endif
32159
+ }
32160
+
32161
+
32162
+ @@ -1309,7 +1334,9 @@
32109
32163
#include <crt_externs.h>
32110
32164
static char **environ;
32111
32165
#elif !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) )
@@ -32115,7 +32169,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32115
32169
#endif /* !_MSC_VER */
32116
32170
32117
32171
static PyObject *
32118
- @@ -1360,7 +1381 ,7 @@
32172
+ @@ -1360,7 +1387 ,7 @@
32119
32173
Py_DECREF(k);
32120
32174
Py_DECREF(v);
32121
32175
}
@@ -32124,7 +32178,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32124
32178
if (environ == NULL)
32125
32179
return d;
32126
32180
/* This part ignores errors */
32127
- @@ -4221,7 +4242 ,12 @@
32181
+ @@ -4221,7 +4248 ,12 @@
32128
32182
long result;
32129
32183
const char *bytes = PyBytes_AsString(command);
32130
32184
Py_BEGIN_ALLOW_THREADS
@@ -32137,7 +32191,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32137
32191
Py_END_ALLOW_THREADS
32138
32192
return result;
32139
32193
}
32140
- @@ -4498,7 +4524 ,7 @@
32194
+ @@ -4498,7 +4530 ,7 @@
32141
32195
static int
32142
32196
utime_dir_fd(utime_t *ut, int dir_fd, const char *path, int follow_symlinks)
32143
32197
{
@@ -32146,7 +32200,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32146
32200
int flags = follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW;
32147
32201
UTIME_TO_TIMESPEC;
32148
32202
return utimensat(dir_fd, path, time, flags);
32149
- @@ -4524,7 +4550 ,7 @@
32203
+ @@ -4524,7 +4556 ,7 @@
32150
32204
static int
32151
32205
utime_fd(utime_t *ut, int fd)
32152
32206
{
@@ -32155,7 +32209,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32155
32209
UTIME_TO_TIMESPEC;
32156
32210
return futimens(fd, time);
32157
32211
#else
32158
- @@ -4547,7 +4573 ,7 @@
32212
+ @@ -4547,7 +4579 ,7 @@
32159
32213
static int
32160
32214
utime_nofollow_symlinks(utime_t *ut, const char *path)
32161
32215
{
@@ -32164,7 +32218,7 @@ index 58cb9b0d46..4a2ae3f024 100644
32164
32218
UTIME_TO_TIMESPEC;
32165
32219
return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
32166
32220
#else
32167
- @@ -4563,7 +4589 ,7 @@
32221
+ @@ -4563,7 +4595 ,7 @@
32168
32222
static int
32169
32223
utime_default(utime_t *ut, const char *path)
32170
32224
{
0 commit comments