From: Ivan Grokhotkov Date: Tue, 8 Nov 2016 01:08:23 +0000 (+0800) Subject: fix order of creation of standard streams X-Git-Tag: v1.0~70^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dd3681115668fc18a7a13624ffe7c5e60a3c513;p=esp-idf fix order of creation of standard streams With existing order, file descriptors assigned to stdin, stdout, stderr didn't match standard assignment. https://github.com/espressif/esp-idf/issues/67 --- diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 2688cd7f81..a96fdee950 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -177,9 +177,9 @@ void start_cpu0_default(void) esp_vfs_dev_uart_register(); esp_reent_init(_GLOBAL_REENT); const char* default_uart_dev = "/dev/uart/0"; + _GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r"); _GLOBAL_REENT->_stdout = fopen(default_uart_dev, "w"); _GLOBAL_REENT->_stderr = fopen(default_uart_dev, "w"); - _GLOBAL_REENT->_stdin = fopen(default_uart_dev, "r"); do_global_ctors(); #if !CONFIG_FREERTOS_UNICORE esp_crosscore_int_init();