Author: marcel
Date: Wed May 21 17:37:22 2014
New Revision: 266511
URL: http://svnweb.freebsd.org/changeset/base/266511
Log:
Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does
not return the error (oops).
Modified:
head/usr.bin/mkimg/scheme.c
Modified: head/usr.bin/mkimg/scheme.c
==============================================================================
--- head/usr.bin/mkimg/scheme.c Wed May 21 17:36:12 2014 (r266510)
+++ head/usr.bin/mkimg/scheme.c Wed May 21 17:37:22 2014 (r266511)
@@ -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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"