fileio: fileio_size() can now fail

Part of making the fileio API more robust.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2010-09-29 09:11:01 +02:00
parent 3a693ef526
commit 3931b99d14
9 changed files with 92 additions and 20 deletions

View File

@@ -180,7 +180,13 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
return retval;
if (!need_size)
state->size = fileio_size(&state->fileio);
{
int filesize;
retval = fileio_size(&state->fileio, &filesize);
if (retval != ERROR_OK)
return retval;
state->size = filesize;
}
*dev = nand;