Page MenuHomeFreeBSD

dma: use canonical getline() loop
ClosedPublic

Authored by emaste on Feb 3 2022, 6:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 21, 1:55 PM
Unknown Object (File)
Thu, Jun 18, 6:01 PM
Unknown Object (File)
Wed, Jun 10, 6:15 AM
Unknown Object (File)
May 28 2026, 11:40 AM
Unknown Object (File)
May 17 2026, 9:22 AM
Unknown Object (File)
May 15 2026, 2:25 PM
Unknown Object (File)
May 15 2026, 12:16 PM
Unknown Object (File)
May 15 2026, 12:31 AM

Details

Summary

getline() returns -1 on erorr or EOF, so just use that condition instead of feof().

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste requested review of this revision.Feb 3 2022, 6:52 PM
emaste created this revision.

I don't know why I went the complicated way in the first place ;)

This revision is now accepted and ready to land.Feb 3 2022, 7:22 PM

explicitly set errno = 0 before loop; getline() leaves it unchanged upon EOF

This revision now requires review to proceed.Feb 4 2022, 5:20 PM

use ferror rather than futzing with errno

This revision was not accepted when it landed; it landed in state Needs Review.Feb 6 2022, 2:56 AM
This revision was automatically updated to reflect the committed changes.