1
1

filtering: close all output descriptors, so that 'xsel' will terminate

For some reason, when copying something to the system clipboard
with 'xsel', it wants to see all output descriptors closed before
it will exit without requiring ^C.

This fixes https://savannah.gnu.org/bugs/?62276.
Reported-by: Shi Yanling <sylphenix@126.com>

Bug existed since version 2.9.8, since piping text through an
external command was introduced.
Этот коммит содержится в:
Benno Schulenberg 2022-04-11 09:20:05 +02:00
родитель ea9d49b9d8
Коммит 6257dec0a7

Просмотреть файл

@ -1034,6 +1034,7 @@ bool execute_command(const char *command)
if (should_pipe) {
if (dup2(to_fd[0], STDIN_FILENO) < 0)
exit(5);
close(from_fd[1]);
close(to_fd[1]);
}