Repository navigation
cksum: report a write error for raw output - #15557
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Merging this PR will improve performance by 28.55%1 warning, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
|
@ChihweiLHBird Is there an existing issue that covers this work? |
5d60f7a to
857c965
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
I didn't find any |
|
Fuzzing failures tracked by #15567. |
The raw digest has no newline, so it stayed in the buffer until the writer was dropped, which discards the error. Flush before the return so a write error is reported and sets the exit code. Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
857c965 to
3d5d4e6
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for your PR |
cksum --rawwrites the digest without a newline, so it stays in the writer's buffer until the writer is dropped, and a drop cannot report an error. On a full disk,cksum --raw f > outleaves an empty file and exits 0. GNU exits 1 withwrite error: No space left on device.This flushes before the early return, so the error goes through the normal write-error path and sets the exit code. The new test sends raw output to
/dev/fulland expects exit 1 with that message.