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)
Sat, Jan 10, 2:35 PM
Unknown Object (File)
Sat, Jan 10, 2:20 AM
Unknown Object (File)
Wed, Dec 24, 4:42 AM
Unknown Object (File)
Nov 29 2025, 4:56 PM
Unknown Object (File)
Nov 22 2025, 9:17 PM
Unknown Object (File)
Nov 13 2025, 1:51 AM
Unknown Object (File)
Nov 13 2025, 1:39 AM
Unknown Object (File)
Nov 8 2025, 1:02 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