mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
ut_logfs: fix fseek()/fread() problem on Windows
This commit is contained in:
parent
14db5c80f1
commit
c038f6b987
@ -41,7 +41,7 @@ int32_t PIOS_Flash_UT_Init(uintptr_t * flash_id, const struct pios_flash_ut_cfg
|
||||
flash_dev->cfg = cfg;
|
||||
flash_dev->transaction_in_progress = false;
|
||||
|
||||
flash_dev->flash_file = fopen ("theflash.bin", "r+");
|
||||
flash_dev->flash_file = fopen ("theflash.bin", "rb+");
|
||||
if (flash_dev->flash_file == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class LogfsTestRaw : public testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
/* create an empty, appropriately sized flash filesystem */
|
||||
FILE * theflash = fopen("theflash.bin", "w");
|
||||
FILE * theflash = fopen("theflash.bin", "wb");
|
||||
uint8_t sector[flash_config.size_of_sector];
|
||||
memset(sector, 0xFF, sizeof(sector));
|
||||
for (uint32_t i = 0; i < flash_config.size_of_flash / flash_config.size_of_sector; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user