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)
Sun, May 17, 10:30 AM
Unknown Object (File)
Sun, May 17, 3:42 AM
Unknown Object (File)
Sun, May 17, 3:35 AM
Unknown Object (File)
Sat, May 16, 4:44 PM
Unknown Object (File)
Thu, May 14, 2:41 AM
Unknown Object (File)
Wed, May 13, 7:09 PM
Unknown Object (File)
Wed, May 13, 12:22 PM
Unknown Object (File)
Wed, May 13, 6:03 AM
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