8000 fix fileutils · python/cpython@1e6f9e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e6f9e5

Browse files
fix fileutils
1 parent 2463bbd commit 1e6f9e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/fileutils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,14 +1468,14 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
14681468
assert(!(atomic_flag_works != NULL && inheritable));
14691469

14701470
if (atomic_flag_works != NULL && !inheritable) {
1471-
if (*atomic_flag_works == -1) {
1471+
if (_Py_atomic_load_int_relaxed(atomic_flag_works) == -1) {
14721472
int isInheritable = get_inheritable(fd, raise);
14731473
if (isInheritable == -1)
14741474
return -1;
1475-
*atomic_flag_works = !isInheritable;
1475+
_Py_atomic_store_int_relaxed(atomic_flag_works, !isInheritable);
14761476
}
14771477

1478-
if (*atomic_flag_works)
1478+
if (_Py_atomic_load_int_relaxed(atomic_flag_works))
14791479
return 0;
14801480
}
14811481

0 commit comments

Comments
 (0)
0