Page MenuHomeFreeBSD

diff: Report I/O errors in Stone algorithm
ClosedPublic

Authored by des on Feb 5 2026, 3:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 21, 3:29 PM
Unknown Object (File)
Thu, Mar 19, 8:33 PM
Unknown Object (File)
Sat, Mar 14, 6:59 PM
Unknown Object (File)
Sat, Mar 7, 3:16 AM
Unknown Object (File)
Mar 3 2026, 1:29 AM
Unknown Object (File)
Mar 2 2026, 12:31 PM
Unknown Object (File)
Feb 26 2026, 11:44 PM
Unknown Object (File)
Feb 25 2026, 11:25 PM
Subscribers

Details

Summary

In the legacy Stone algorithm, we do a first pass over the files to
check if they're identical before we start diffing them. That code
would correctly set the exit status if an I/O error was encountered,
but would not emit an error message. Do so.

PR: 292198
Fixes: 55f160fb07ea ("diff: Print an error message on I/O error")
MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Feb 5 2026, 3:44 PM
This revision is now accepted and ready to land.Feb 5 2026, 3:47 PM
olce added inline comments.
usr.bin/diff/diffreg.c
506–509

Putting the assignments in the if makes things less readable, especially given that i and j are not used in the test nor if blocks.

You might want to rename i and j for better clarity.

This revision was automatically updated to reflect the committed changes.