mirror of https://github.com/ARMmbed/mbed-os.git
Sync output devices on exit
Mbed retarget does an `fflush` on stdout and stderr on exit - this flushes the C library buffers (if it is buffering), but doesn't flush any device buffers (eg UARTSerial's TX buffer). Add sync() calls to the output device to do this.pull/8076/head
parent
78f4b4bc82
commit
d05c60ee3f
|
@ -1250,6 +1250,8 @@ extern "C" void exit(int return_code)
|
||||||
#if MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT
|
#if MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
fsync(STDOUT_FILENO);
|
||||||
|
fsync(STDERR_FILENO);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue