Skip to content

Commit 8da1b8b

Browse files
committed
Merge branch 'contrib/github_pr_14393' into 'master'
strerror for clearer Error detection (GitHub PR) Closes IDFGH-13496 See merge request espressif/esp-idf!32914
2 parents 5bfa1fb + d836ea0 commit 8da1b8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/peripherals/uart/uart_select/main/uart_select_example_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
CONDITIONS OF ANY KIND, either express or implied.
88
*/
99
#include <stdio.h>
10+
#include <string.h>
1011
#include <sys/fcntl.h>
1112
#include <sys/errno.h>
1213
#include <sys/unistd.h>
@@ -63,7 +64,7 @@ static void uart_select_task(void *arg)
6364
s = select(fd + 1, &rfds, NULL, NULL, &tv);
6465

6566
if (s < 0) {
66-
ESP_LOGE(TAG, "Select failed: errno %d", errno);
67+
ESP_LOGE(TAG, "Select failed: errno %d (%s)", errno, strerror(errno));
6768
break;
6869
} else if (s == 0) {
6970
ESP_LOGI(TAG, "Timeout has been reached and nothing has been received");

0 commit comments

Comments
 (0)