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
66a5a592
Commit
66a5a592
authored
Apr 01, 2015
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23836: Use _Py_write_noraise() to retry on EINTR in child_exec() of
_posixsubprocess
parent
13372f21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Modules/_posixsubprocess.c
Modules/_posixsubprocess.c
+10
-9
No files found.
Modules/_posixsubprocess.c
View file @
66a5a592
...
...
@@ -382,7 +382,7 @@ child_exec(char *const exec_array[],
PyObject
*
preexec_fn
,
PyObject
*
preexec_fn_args_tuple
)
{
int
i
,
saved_errno
,
unused
,
reached_preexec
=
0
;
int
i
,
saved_errno
,
reached_preexec
=
0
;
PyObject
*
result
;
const
char
*
err_msg
=
""
;
/* Buffer large enough to hold a hex integer. We can't malloc. */
...
...
@@ -496,28 +496,29 @@ error:
saved_errno
=
errno
;
/* Report the posix error to our parent process. */
/* We ignore all write() return values as the total size of our writes is
* less than PIPEBUF and we cannot do anything about an error anyways. */
less than PIPEBUF and we cannot do anything about an error anyways.
Use _Py_write_noraise() to retry write() if it is interrupted by a
signal (fails with EINTR). */
if
(
saved_errno
)
{
char
*
cur
;
unused
=
writ
e
(
errpipe_write
,
"OSError:"
,
8
);
_Py_write_norais
e
(
errpipe_write
,
"OSError:"
,
8
);
cur
=
hex_errno
+
sizeof
(
hex_errno
);
while
(
saved_errno
!=
0
&&
cur
>
hex_errno
)
{
*--
cur
=
"0123456789ABCDEF"
[
saved_errno
%
16
];
saved_errno
/=
16
;
}
unused
=
writ
e
(
errpipe_write
,
cur
,
hex_errno
+
sizeof
(
hex_errno
)
-
cur
);
unused
=
writ
e
(
errpipe_write
,
":"
,
1
);
_Py_write_norais
e
(
errpipe_write
,
cur
,
hex_errno
+
sizeof
(
hex_errno
)
-
cur
);
_Py_write_norais
e
(
errpipe_write
,
":"
,
1
);
if
(
!
reached_preexec
)
{
/* Indicate to the parent that the error happened before exec(). */
unused
=
writ
e
(
errpipe_write
,
"noexec"
,
6
);
_Py_write_norais
e
(
errpipe_write
,
"noexec"
,
6
);
}
/* We can't call strerror(saved_errno). It is not async signal safe.
* The parent process will look the error message up. */
}
else
{
unused
=
writ
e
(
errpipe_write
,
"SubprocessError:0:"
,
18
);
unused
=
writ
e
(
errpipe_write
,
err_msg
,
strlen
(
err_msg
));
_Py_write_norais
e
(
errpipe_write
,
"SubprocessError:0:"
,
18
);
_Py_write_norais
e
(
errpipe_write
,
err_msg
,
strlen
(
err_msg
));
}
if
(
unused
)
return
;
/* silly? yes! avoids gcc compiler warning. */
}
...
...
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