diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2014-05-21 17:37:22 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2014-05-21 17:37:22 +0000 |
commit | a513818762a58a7bc29d04c2a41a3903485469c2 (patch) | |
tree | 62fbd9d5ba3a8e9aebb4759145111435d23abee1 /usr.bin/mkimg | |
parent | 9746454f547f68c540d41228064207658cc1697e (diff) | |
download | src-a513818762a58a7bc29d04c2a41a3903485469c2.tar.gz src-a513818762a58a7bc29d04c2a41a3903485469c2.zip |
Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does
not return the error (oops).
Notes
Notes:
svn path=/head/; revision=266511
Diffstat (limited to 'usr.bin/mkimg')
-rw-r--r-- | usr.bin/mkimg/scheme.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/mkimg/scheme.c b/usr.bin/mkimg/scheme.c index 79312effac26..7546ae289f34 100644 --- a/usr.bin/mkimg/scheme.c +++ b/usr.bin/mkimg/scheme.c @@ -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); |