tools: Make progress bar starting more consistent
Change-Id: I0bfa967efa1c350551dd7b68f9fd72695db638c7
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/tools/lpc.cpp b/tools/lpc.cpp
index d552b6a..2a65379 100644
--- a/tools/lpc.cpp
+++ b/tools/lpc.cpp
@@ -111,18 +111,17 @@
return false;
}
- progress->start(fileSize);
-
/* For Nuvoton the maximum is 4K */
auto readBuffer = std::make_unique<std::uint8_t[]>(host_lpc_buf.length);
if (nullptr == readBuffer)
{
- progress->abort();
sys->close(inputFd);
std::fprintf(stderr, "Unable to allocate memory for read buffer.\n");
return false;
}
+ progress->start(fileSize);
+
/* TODO: This is similar to PCI insomuch as how it sends data, so combine.
*/
try