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

@@ -105,7 +105,11 @@ bool set_child_group(job_t *j, process_t *p, int print_errors) {
}
if (job_get_flag(j, JOB_TERMINAL) && job_get_flag(j, JOB_FOREGROUND)) { //!OCLINT(early exit)
int result = tcsetpgrp(STDIN_FILENO, j->pgid); // to avoid "collapsible if statements" warn
int result = -1;
errno = EINTR;
while (result == -1 && errno == EINTR) {
result = tcsetpgrp(STDIN_FILENO, j->pgid);
}
if (result == -1) {
if (errno == ENOTTY) redirect_tty_output();
if (print_errors) {