Index: src/platform/update_engine/utils.cc |
diff --git a/src/platform/update_engine/utils.cc b/src/platform/update_engine/utils.cc |
index 724a4ba81e0733319340ff818f0a42bfcfd56e81..85d9e7db559d884414c7016d8fb2f763b08feffb 100644 |
--- a/src/platform/update_engine/utils.cc |
+++ b/src/platform/update_engine/utils.cc |
@@ -105,6 +105,15 @@ bool ReadFileToString(const std::string& path, std::string* out) { |
return true; |
} |
+off_t FileSize(const string& path) { |
+ struct stat stbuf; |
+ int rc = stat(path.c_str(), &stbuf); |
+ CHECK_EQ(rc, 0); |
+ if (rc < 0) |
+ return rc; |
+ return stbuf.st_size; |
+} |
+ |
void HexDumpArray(const unsigned char* const arr, const size_t length) { |
const unsigned char* const char_arr = |
reinterpret_cast<const unsigned char* const>(arr); |