commit 6257dec0a733c390dbd1c9ce9b739a0fe6d3bd4e
parent ea9d49b9d8e48c2da8224b3301dad8e8868479d8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 11 Apr 2022 09:20:05 +0200
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.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -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]);
}