mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-23 16:51:16 -03:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user