Open image files in binary mode
This is required for read() to function correctly in Windows since it behaves differently in text mode and binary mode and may cause unpredictable behavior depending on the contents of the image file. Bug: 129281908 Test: fastboot.exe flashall Change-Id: I64370af44a050bafea60ff1b0b2be18cc531480a
This commit is contained in:
parent
aaee497db2
commit
1a6f6feff4
|
@ -1407,7 +1407,7 @@ bool LocalImageSource::ReadFile(const std::string& name, std::vector<char>* out)
|
|||
|
||||
int LocalImageSource::OpenFile(const std::string& name) const {
|
||||
auto path = find_item_given_name(name);
|
||||
return open(path.c_str(), O_RDONLY);
|
||||
return open(path.c_str(), O_RDONLY | O_BINARY);
|
||||
}
|
||||
|
||||
static void do_flashall(const std::string& slot_override, bool skip_secondary, bool wipe) {
|
||||
|
|
Loading…
Reference in New Issue