Page MenuHomeFreeBSD

comm: close a race condition when comm is fed from stdin
ClosedPublic

Authored by ccecchi_apple.com on Jun 1 2024, 3:57 PM.
Tags
None
Referenced Files
F146218012: D45440.id.diff
Sat, Feb 28, 8:31 PM
Unknown Object (File)
Sat, Feb 28, 6:24 PM
Unknown Object (File)
Sat, Feb 28, 5:18 PM
Unknown Object (File)
Tue, Feb 24, 8:54 AM
Unknown Object (File)
Sun, Feb 8, 10:03 PM
Unknown Object (File)
Sun, Feb 8, 11:33 AM
Unknown Object (File)
Sat, Feb 7, 8:08 PM
Unknown Object (File)
Sat, Jan 31, 12:41 PM
Subscribers

Details

Summary

If one of the files has ended, we won't show the column, but we still
need to drain the file pointer to avoid potentially hitting a pipe
failure.

This commit moves the NULL offset checks inside show() so that getline()
and ferror() are still called on fp.

Diff Detail

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