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
Unknown Object (File)
Mon, Jun 2, 4:45 PM
Unknown Object (File)
Fri, May 30, 1:10 AM
Unknown Object (File)
Fri, May 9, 6:18 PM
Unknown Object (File)
May 5 2025, 6:18 PM
Unknown Object (File)
Apr 16 2025, 4:04 AM
Unknown Object (File)
Apr 15 2025, 12:30 PM
Unknown Object (File)
Mar 10 2025, 5:16 AM
Unknown Object (File)
Feb 18 2025, 7:48 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