diff options
author | Ola Borgelin <ola.borgelin@stericsson.com> | 2011-06-09 11:36:08 +0200 |
---|---|---|
committer | Ola Borgelin <ola.borgelin@stericsson.com> | 2011-06-09 11:36:08 +0200 |
commit | 6afe5426242576e5af531365cafef0098b149b6d (patch) | |
tree | 6e98e119271e54fb8bf886a846b6e97fac102a8d /riff | |
parent | b76c2437f1017bda4879a3a8ee6ddd00fdb5c281 (diff) |
Riff stabilty fixes
Add support for files larger than 4 GB and improve stability.
Diffstat (limited to 'riff')
-rwxr-xr-x | riff/ProcessRawImage.cpp | 13 | ||||
-rwxr-xr-x | riff/ProcessRawImage.h | 2 | ||||
-rwxr-xr-x | riff/main.cpp | 4 |
3 files changed, 11 insertions, 8 deletions
diff --git a/riff/ProcessRawImage.cpp b/riff/ProcessRawImage.cpp index a46337b..77f9715 100755 --- a/riff/ProcessRawImage.cpp +++ b/riff/ProcessRawImage.cpp @@ -22,6 +22,7 @@ #include <stdlib.h> #include <sys/stat.h> #include "LCDriver.h" + using namespace flash; ProcessRawImage::ProcessRawImage(const char* path, uint64 start, int useBulk, int deleteBuffers): @@ -36,8 +37,9 @@ ProcessRawImage::ProcessRawImage(const char* path, uint64 start, int useBulk, in int ProcessRawImage::run(DUT* dut) { - logger_.log(Logger::PROGRESS, "Flashing raw image..."); + logger_.log(Logger::PROGRESS, "Flashing raw image..."); uint64 length = filesize(pchPath); + logger_.log(Logger::PROGRESS, "Filesize: %lld", length); int error = 0; if (length != 0) { @@ -60,13 +62,14 @@ int ProcessRawImage::run(DUT* dut) return error; } -size_t ProcessRawImage::filesize(const char* filename) +uint64 ProcessRawImage::filesize(const char* filename) { - struct stat st; + struct stat64 st; - if (stat(filename, &st) == 0) + if (stat64(filename, &st) == 0) + { return st.st_size; - + } return 0; } diff --git a/riff/ProcessRawImage.h b/riff/ProcessRawImage.h index b429b88..7042e17 100755 --- a/riff/ProcessRawImage.h +++ b/riff/ProcessRawImage.h @@ -49,7 +49,7 @@ public: private: Logger logger_; - size_t filesize(const char* filename); + uint64 filesize(const char* filename); const char* pchPath; uint64 uiStart; uint32 uiDevice; diff --git a/riff/main.cpp b/riff/main.cpp index 076a65f..5ce8e65 100755 --- a/riff/main.cpp +++ b/riff/main.cpp @@ -26,11 +26,11 @@ #include <cstdio> using namespace std; -bool isDone = false; +volatile bool isDone = false; const string info = \ "\n \ ----------------------- riff - Raw Image File Flasher -------------------------\n \ -Version: 0.4.1\n \ +Version: 0.4.2\n \ " "Flash a device. Try `riff --help' for more information. \n \ " |