From 6dd3681115668fc18a7a13624ffe7c5e60a3c513 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 8 Nov 2016 09:08:23 +0800 Subject: [PATCH] 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 --- components/esp32/cpu_start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- 2.40.0