HomeFreeBSD

efivar: handle error when reading --fromfile

Description

efivar: handle error when reading --fromfile

The result of read() was stored in an unsigned variable, so the
test for a negative value would never work.

While I'm here, print a better error message for an empty file,
omitting the misleading errno message.

Reported by: Coverity
MFC after: 1 week
Sponsored by: Dell EMC Isilon

(cherry picked from commit d0f4e583bff67e2bdd816549c460da6daa3f67b1)

Details

Provenance
vangyzenAuthored on Feb 23 2022, 6:15 PM
Parents
rGd8d0ac7b5d73: efivar: use bool for booleans
Branches
Unknown
Tags
Unknown