coreutils/tests
Cả thế giới là Rust fd83181ac2
Fix EINTR handling in cat, od, and comm (#8946)
* fix: handle EINTR (signal interruptions) in cat, od, and comm

Add proper retry loops for ErrorKind::Interrupted in I/O operations
to handle signals like SIGUSR1 that can interrupt read/write calls.

This pattern is proven in production - identical to PR #6025 (merged
March 2024) which fixed dd's EINTR handling for GNU test dd/stats.sh.
The same pattern is already used in 9+ utilities (head, tail, tee, wc,
sort, sum, tr, shuf, dd) without issues.

Changes:
- cat: Fix write_fast() and write_lines() to retry on EINTR
- od: Fix PartialReader::read() in all three read paths
- comm: Fix are_files_identical() for both file readers
- tests: Add InterruptingReader/Writer test utilities

Historical context:
- Pattern validated by cre4ture's PR #6025 (dd EINTR fix)
- Matches existing implementations in dd/dd.rs:450,881
- POSIX best practice for signal-interrupted I/O

Fixes #1275

* fix: handle EINTR (signal interruptions) in cat, od, and comm

Add proper retry loops for ErrorKind::Interrupted in I/O operations to handle signals like SIGUSR1 that can interrupt read/write calls.

Pattern matches PR #6025 (dd EINTR fix) and is already used in 9+ utilities. Changes:
- cat: Fix write_fast() and write_lines() to retry on EINTR
- od: Fix PartialReader::read() in all three read paths
- comm: Fix are_files_identical() for both file readers
- tests: Add visible EINTR integration tests for CI

Addresses sylvestre's review feedback on code documentation and CI test visibility.

* style: apply cargo fmt formatting to EINTR changes

* test: fix EINTR integration test failures

- Fix comm test: use stdout_contains instead of stdout_only for tabbed output
- Fix od test: create new command instance to avoid 'already run this UCommand' error
- Remove unused imports and dead code to eliminate compiler warnings
- Both tests now pass without warnings or errors

* style: fix formatting and remove duplicate comment in od test

* ci: add EINTR and related technical terms to appropriate cspell dictionaries

- Add EINTR, eintr, nextest to jargon.wordlist.txt (technical/systems programming terms)
- Add SIGUSR, SIGINT, etc. to shell.wordlist.txt (POSIX signals)
- Add uutils, coreutils, ucmd, etc. to workspace.wordlist.txt (project-specific terms)
- Fixes CI cspell warnings for legitimate technical terminology
- Proper categorization follows existing dictionary structure
2025-10-26 13:59:47 +01:00
..
benches/factor chore: cleanup unused dependencies 2025-07-02 19:47:23 -04:00
by-util Fix EINTR handling in cat, od, and comm (#8946) 2025-10-26 13:59:47 +01:00
fixtures sort: generate test_start_buffer fixtures programmatically 2025-10-11 16:35:10 +02:00
uudoc uudoc: move manpage generation away from the binary 2025-10-22 01:17:08 -07:00
uutests who: honor locale settings 2025-09-01 22:36:54 +08:00
test_localization_and_colors.rs clap/locale: fix the colors for all programs (Closes: #8501) 2025-09-05 08:25:59 +02:00
test_util_name.rs uudoc: move manpage generation away from the binary 2025-10-22 01:17:08 -07:00
tests.rs uudoc: move manpage generation away from the binary 2025-10-22 01:17:08 -07:00