1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

emulation on host: avoid closing STDIN (#8577)

- avoid closing STDIN
- less verbose during compilation
- better handling user directories
- missing str{,n}case_P declarations
This commit is contained in:
david gauchard
2022-05-20 16:54:27 +02:00
committed by GitHub
parent 8f71d2c042
commit b080c50713
4 changed files with 15 additions and 6 deletions

View File

@ -115,8 +115,14 @@ static int mock_stop_uart(void)
static uint8_t mock_read_uart(void)
{
uint8_t ch = 0;
return (read(STDIN, &ch, 1) == 1) ? ch : 0;
uint8_t ch = 0;
int ret = read(STDIN, &ch, 1);
if (ret == -1)
{
perror("read(STDIN,1)");
return 0;
}
return (ret == 1) ? ch : 0;
}
void help(const char* argv0, int exitcode)