Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c8b2e770
Commit
c8b2e770
authored
Dec 31, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore signalhandler in case of error. Fix type of signal handler.
parent
c5f5f87f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Modules/posixmodule.c
Modules/posixmodule.c
+9
-3
No files found.
Modules/posixmodule.c
View file @
c8b2e770
...
...
@@ -2744,7 +2744,7 @@ posix_openpty(PyObject *self, PyObject *args)
char
*
slave_name
;
#endif
#if defined(HAVE_DEV_PTMX) && !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY)
void
*
sig_saved
;
PyOS_sighandler_t
sig_saved
;
#ifdef sun
extern
char
*
ptsname
();
#endif
...
...
@@ -2769,10 +2769,16 @@ posix_openpty(PyObject *self, PyObject *args)
if
(
master_fd
<
0
)
return
posix_error
();
sig_saved
=
signal
(
SIGCHLD
,
SIG_DFL
);
if
(
grantpt
(
master_fd
)
<
0
)
/* change permission of slave */
/* change permission of slave */
if
(
grantpt
(
master_fd
)
<
0
)
{
signal
(
SIGCHLD
,
sig_saved
);
return
posix_error
();
if
(
unlockpt
(
master_fd
)
<
0
)
/* unlock slave */
}
/* unlock slave */
if
(
unlockpt
(
master_fd
)
<
0
)
{
signal
(
SIGCHLD
,
sig_saved
);
return
posix_error
();
}
signal
(
SIGCHLD
,
sig_saved
);
slave_name
=
ptsname
(
master_fd
);
/* get name of slave */
if
(
slave_name
==
NULL
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment