mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
77b754b47f
'read' function should return 0 when encountering an end of file. When newlib calls read and sees EOF returned, it assumes that this condition is permanent and never calls 'read' for this file again (unless the read pointer is moved using fseek). The correct behavior in case no characters were received over UART is to return -1. In this case newlib will retry reading from file on next call to fread, fgetc or another function which calls __srefill_r.