Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does

not return the error (oops).
This commit is contained in:
Marcel Moolenaar 2014-05-21 17:37:22 +00:00
parent 9746454f54
commit a513818762
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266511

View File

@ -103,14 +103,12 @@ int
scheme_bootcode(int fd)
{
struct stat sb;
int error;
if (scheme->bootcode == 0)
return (ENXIO);
error = fstat(fd, &sb);
if (error)
return (error);
if (fstat(fd, &sb) == -1)
return (errno);
if (sb.st_size > scheme->bootcode)
return (EFBIG);