netlib: Replace perror with nerr

Use the nerr interface for error print.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
This commit is contained in:
zhangshuai39 2026-01-13 11:30:51 +08:00 committed by Xiang Xiao
parent faefee4897
commit 11c8220fd5

View file

@ -224,7 +224,7 @@ int netlib_check_httpconnectivity(FAR const char *host,
ret = connect(sock, (struct sockaddr *)&server_addr, sizeof(server_addr));
if (ret < 0)
{
perror("Connection failed");
nerr("Connection failed: %s", strerror(errno));
goto exit_with_socket;
}
@ -235,13 +235,13 @@ int netlib_check_httpconnectivity(FAR const char *host,
ret = send(sock, buf, strlen(buf), 0);
if (ret < 0)
{
perror("send failed");
nerr("send failed: %s", strerror(errno));
goto exit_with_socket;
}
if ((ret = recv(sock, buf, sizeof(buf), 0)) < 0)
{
perror("recv failed");
nerr("recv failed: %s", strerror(errno));
goto exit_with_socket;
}