+
Skip to content

tail: handle broken pipe gracefully #8327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged

tail: handle broken pipe gracefully #8327

merged 2 commits into from
Jul 10, 2025

Conversation

tgrez
Copy link
Contributor

@tgrez tgrez commented Jul 10, 2025

Fixes #4965.

The original issue can be reproduced with:
Edit: I misunderstood #4965, but it's related.

The incorrect handling of broken pipe can be reproduced with:

$ echo "oneline" > file
$ tail file | false
$
$ coreutils tail file | false
tail: Broken pipe
$

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Comment on lines +698 to +702
assert!(
self.stderr.is_empty(),
"Expected stderr to be empty, but it's:\n{}",
self.stderr_str()
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little change :)

@cakebaker cakebaker merged commit 685969e into uutils:main Jul 10, 2025
76 checks passed
@cakebaker
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tail does not exit when pipe is broken
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载