Commit f24b0ad0 for xz
commit f24b0ad02d4a60979a567cd5b11edc75c6bd1bdd
Author: Lasse Collin <lasse.collin@tukaani.org>
Date: Mon Nov 30 17:07:40 2026 +0200
xz: Fix EINTR handling in --files and --files0
Progress indicator signals (SIGALRM, SIGUSR1, and SIGINFO) and SIGTSTP
don't set user_abort. If such a signal was received when waiting for
more input from the file specified with --files or --files0, the
remaining filenames were ignored and xz went into an infinite loop.
xz still reacted to SIGINT and such signals normally.
It can be reproduced at least on Linux/glibc:
( echo /dev/null; sleep 2; echo /dev/null ) | xz -vc --files > /dev/null
diff --git a/src/xz/main.c b/src/xz/main.c
index fe5ff4ad..726e2174 100644
--- a/src/xz/main.c
+++ b/src/xz/main.c
@@ -83,8 +83,10 @@ read_name(const args_info *args)
if (ferror(args->files_file)) {
// Take care of EINTR since we have established
// the signal handlers already.
- if (errno == EINTR)
+ if (errno == EINTR) {
+ clearerr(args->files_file);
continue;
+ }
message_error(_("%s: Error reading filenames: %s"),
tuklib_mask_nonprint(args->files_name),