Page MenuHomeFreeBSD

dma: use canonical getline() loop
ClosedPublic

Authored by emaste on Feb 3 2022, 6:52 PM.
Tags
None
Referenced Files
F108478470: D34159.id102337.diff
Sat, Jan 25, 8:22 AM
Unknown Object (File)
Tue, Jan 21, 10:39 PM
Unknown Object (File)
Fri, Jan 17, 3:33 PM
Unknown Object (File)
Sat, Jan 11, 6:50 PM
Unknown Object (File)
Fri, Jan 10, 8:49 AM
Unknown Object (File)
Fri, Jan 10, 2:55 AM
Unknown Object (File)
Dec 6 2024, 8:23 AM
Unknown Object (File)
Dec 1 2024, 11:00 AM

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.