mbed-os/libraries/mbed
Adam Green c6d2c81c7f LocalFileSystem fails to open binary files
Fixes issue #1562 reported by @justbuchanan.

When building code with GCC-ARM / newlib, attempting to use the
b (binary) mode in a fopen() call would fail. newlib would parse
this option and pass it down to the LocalFileSystem open call which
didn't like the unexpected O_BINARY flag in openmode.

The openmode_to_posix() function in retarget.cpp would never set the
O_BINARY flag for the other toolchains but for GCC it would just pass
down whatever newlib placed there.  This commit masks out the O_BINARY
bit so that it never gets passed down to the file system drivers, just
as occurs for the other supported toolchains.

Test case:
  FILE *fp = fopen("/local/out.txt", "rb");

I tested that code on mbed LPC1768 and LPC11U24 boards while using
GCC_ARM as the toolchain. It failed on both platforms previous to
this change and succeeded there after.
2016-03-07 13:34:32 -08:00
..
api mbed lib revision - 115 2016-03-02 11:02:18 +01:00
common LocalFileSystem fails to open binary files 2016-03-07 13:34:32 -08:00
hal [B96B_F446VE] remove unused IRQ_RX1 interrupt 2016-02-22 15:24:42 +01:00
targets Merge pull request #1588 from adustm/master 2016-03-07 09:45:59 +00:00
.yotta_ignore ignore target files not supported by the yotta module, to minimise published module size 2015-09-09 09:30:31 +01:00
CMakeLists.txt ensure startup code is included when building for armcc 2015-06-26 18:42:12 +01:00
module.json use mbed-classic as the module name; use YOTTA_GLOBAL_INCLUDE_DIRS 2015-06-23 16:29:04 +01:00