diff options
Diffstat (limited to 'src/flash/nand')
-rw-r--r-- | src/flash/nand/fileio.c | 8 | ||||
-rw-r--r-- | src/flash/nand/tcl.c | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/flash/nand/fileio.c b/src/flash/nand/fileio.c index 0a006fc0..c7515e2f 100644 --- a/src/flash/nand/fileio.c +++ b/src/flash/nand/fileio.c @@ -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; diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index a54f8ea8..15cf1797 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -388,9 +388,14 @@ COMMAND_HANDLER(handle_nand_dump_command) if (nand_fileio_finish(&s) == ERROR_OK) { + int filesize; + retval = fileio_size(&s.fileio, &filesize); + if (retval != ERROR_OK) + return retval; + command_print(CMD_CTX, "dumped %ld bytes in %fs (%0.3f KiB/s)", - (long)fileio_size(&s.fileio), duration_elapsed(&s.bench), - duration_kbps(&s.bench, fileio_size(&s.fileio))); + (long)filesize, duration_elapsed(&s.bench), + duration_kbps(&s.bench, filesize)); } return ERROR_OK; } |