Loop until all bytes are read or a real error occurs, instead of
assuming a single read() returns the entire file. Retry on EINTR
and break on EOF. Use intmax_t casts in the error message to
match off_t portably.
Signed-off-by: Christos Longros
Differential D56500
rtlbtfw: handle partial reads when loading firmware Authored by chris.longros_gmail.com on Sat, Apr 18, 11:44 AM. Tags None Referenced Files
Subscribers
Details
Loop until all bytes are read or a real error occurs, instead of Signed-off-by: Christos Longros
Diff Detail
Event TimelineComment Actions Although it looks good, replacing read() with mmap() -> memcpy() -> munmap() sequence would make code simpler and cleaner Comment Actions I committed mmap()-based changes. See: https://cgit.freebsd.org/src/commit/?id=87ed6840a0a6320295f6abb43a987d20ae126cf7 |