There was an error while loading. Please reload this page.
1 parent 2463bbd commit ef6f457Copy full SHA for ef6f457
2 files changed
Modules/socketmodule.c
@@ -5401,8 +5401,7 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
5401
5402
#ifndef MS_WINDOWS
5403
#ifdef SOCK_CLOEXEC
5404
- int cloexec_works = GET_SOCK_CLOEXEC_WORKS();
5405
- int *atomic_flag_works = &cloexec_works;
+ int *atomic_flag_works = &sock_cloexec_works;
5406
#else
5407
int *atomic_flag_works = NULL;
5408
#endif
@@ -6307,8 +6306,7 @@ socket_socketpair(PyObject *self, PyObject *args)
6307
6306
PyObject *res = NULL;
6308
socket_state *state = get_module_state(self);
6309
6310
6311
6312
6313
6314
Python/fileutils.c
@@ -1468,14 +1468,14 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
1468
assert(!(atomic_flag_works != NULL && inheritable));
1469
1470
if (atomic_flag_works != NULL && !inheritable) {
1471
- if (*atomic_flag_works == -1) {
+ if (_Py_atomic_load_int_relaxed(atomic_flag_works) == -1) {
1472
int isInheritable = get_inheritable(fd, raise);
1473
if (isInheritable == -1)
1474
return -1;
1475
- *atomic_flag_works = !isInheritable;
+ _Py_atomic_store_int_relaxed(atomic_flag_works, !isInheritable);
1476
}
1477
1478
- if (*atomic_flag_works)
+ if (_Py_atomic_load_int_relaxed(atomic_flag_works))
1479
return 0;
1480
1481
0 commit comments