1
0
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:
Oleg Semyonov 2013-02-24 03:21:12 +02:00 committed by Alessio Morale
parent 14db5c80f1
commit c038f6b987
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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++) {