mbed-os/libraries
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
..
USBDevice Support of export function to the IAR. 2016-02-15 14:49:31 +09:00
USBHost Support of export function to the IAR. 2016-02-15 14:49:31 +09:00
doc Initial commit of the mbed libraries and tools 2013-02-18 15:32:11 +00:00
dsp [dsp lib] update CMSIS dsp 4.5 2015-11-18 23:26:25 +01:00
fs [FATFileSystem] Fixed API integer widths 2015-11-26 09:59:52 -07:00
mbed LocalFileSystem fails to open binary files 2016-03-07 13:34:32 -08:00
net Modify the format of code 2015-11-02 17:50:04 +09:00
rpc Add RZ_A1H in RPC. 2015-08-07 16:20:22 +09:00
rtos Add STM32L073RZ device 2016-02-29 16:21:24 +01:00
tests Adding more [NOT_SUPPORTED] messages to tests 2016-03-02 13:13:36 -06:00