mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 10:39:11 -04:00
esp-tls: check return value of fcntl
This commit is contained in:
parent
85656ca77d
commit
23e6b47a28
@ -134,7 +134,11 @@ static esp_err_t esp_tcp_connect(const char *host, int hostlen, int port, int *s
|
|||||||
}
|
}
|
||||||
if (cfg->non_block) {
|
if (cfg->non_block) {
|
||||||
int flags = fcntl(fd, F_GETFL, 0);
|
int flags = fcntl(fd, F_GETFL, 0);
|
||||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||||
|
if (ret < 0) {
|
||||||
|
ESP_LOGE(TAG, "Failed to configure the socket as non-blocking (errno %d)", errno);
|
||||||
|
goto err_freesocket;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user