remove unnecessary signal management

The shell was doing a log of signal blocking/unblocking that hurts
performance and can be avoided. This reduced the elapsed time for a
simple benchmark by 25%.

Partial fix for #2007
This commit is contained in:
Kurtis Rader
2016-12-28 18:52:33 -08:00
parent 51adf815aa
commit fd6d814ea4
8 changed files with 113 additions and 85 deletions

View File

@@ -367,12 +367,10 @@ static bool can_use_posix_spawn_for_job(const job_t *job, const process_t *proce
void exec_job(parser_t &parser, job_t *j) {
pid_t pid = 0;
sigset_t chldset;
// Set to true if something goes wrong while exec:ing the job, in which case the cleanup code
// will kick in.
bool exec_error = false;
bool needs_keepalive = false;
process_t keepalive;
@@ -384,9 +382,6 @@ void exec_job(parser_t &parser, job_t *j) {
return;
}
sigemptyset(&chldset);
sigaddset(&chldset, SIGCHLD);
debug(4, L"Exec job '%ls' with id %d", j->command_wcstr(), j->job_id);
// Verify that all IO_BUFFERs are output. We used to support a (single, hacked-in) magical input