Add a comment for why we reset SIGPIPE

This commit is contained in:
Kovid Goyal 2018-12-20 09:29:09 +05:30
parent 056c2c12bb
commit 9c4230ad9c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -115,6 +115,8 @@ spawn(PyObject *self UNUSED, PyObject *args) {
for (int c = 3; c < 201; c++) close(c);
environ = env;
// for some reason SIGPIPE is set to SIG_IGN, so reset it, needed by bash,
// which does not reset signal handlers on its own
signal(SIGPIPE, SIG_DFL);
execvp(exe, argv);
// Report the failure and exec a shell instead, so that we are not left