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)
Thu, Jun 27, 9:00 PM
Unknown Object (File)
Wed, Jun 26, 11:55 PM
Unknown Object (File)
Sat, Jun 8, 12:03 PM
Unknown Object (File)
Wed, Jun 5, 6:20 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