mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
Check return code of fwrite in raw image writing code.
Change-Id: I8c52a205ae1dc559c9f8b41d4d2c50e821b3b05c BUG=None TEST=None Review URL: http://codereview.chromium.org/6368153
This commit is contained in:
@@ -1017,9 +1017,12 @@ write_block_raw(build_image_context *context)
|
||||
data = empty_blk;
|
||||
}
|
||||
/* Write the data */
|
||||
fwrite(data, 1,
|
||||
pages_to_write * context->page_size,
|
||||
context->raw_file);
|
||||
{
|
||||
size_t bytes = pages_to_write * context->page_size;
|
||||
|
||||
if (fwrite(data, 1, bytes, context->raw_file) != bytes)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
free(empty_blk);
|
||||
|
||||
Reference in New Issue
Block a user