Skip to content

Commit 38fb2b3

Browse files
committed
pythongh-114727: Update os_{openpty|grantpt}_impl to use per module lock.
1 parent 408e127 commit 38fb2b3

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

‎Modules/clinic/posixmodule.c.h‎

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/posixmodule.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8419,6 +8419,7 @@ os_posix_openpt_impl(PyObject *module, int oflag)
84198419

84208420
#ifdef HAVE_GRANTPT
84218421
/*[clinic input]
8422+
@critical_section
84228423
os.grantpt
84238424
84248425
fd: fildes
@@ -8432,7 +8433,7 @@ Performs a grantpt() C function call.
84328433

84338434
static PyObject *
84348435
os_grantpt_impl(PyObject *module, int fd)
8435-
/*[clinic end generated code: output=dfd580015cf548ab input=0668e3b96760e849]*/
8436+
/*[clinic end generated code: output=dfd580015cf548ab input=c813b58c0ee7d9a0]*/
84368437
{
84378438
int ret;
84388439
int saved_errno;
@@ -8547,6 +8548,7 @@ os_ptsname_impl(PyObject *module, int fd)
85478548

85488549
#if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX)
85498550
/*[clinic input]
8551+
@critical_section
85508552
os.openpty
85518553
85528554
Open a pseudo-terminal.
@@ -8557,7 +8559,7 @@ for both the master and slave ends.
85578559

85588560
static PyObject *
85598561
os_openpty_impl(PyObject *module)
8560-
/*[clinic end generated code: output=98841ce5ec9cef3c input=f3d99fd99e762907]*/
8562+
/*[clinic end generated code: output=98841ce5ec9cef3c input=49472bedd2dfaffe]*/
85618563
{
85628564
int master_fd = -1, slave_fd = -1;
85638565
#ifndef HAVE_OPENPTY

0 commit comments

Comments
 (0)