Merge pull request #1941 from HubertXie/master

Update at_socket.c
This commit is contained in:
Bernard Xiong 2018-11-01 19:48:05 +08:00 committed by GitHub
commit 198e108bcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -668,6 +668,7 @@ int at_recvfrom(int socket, void *mem, size_t len, int flags, struct sockaddr *f
if (rt_sem_take(sock->recv_notice, timeout) < 0)
{
LOG_E("AT socket (%d) receive timeout (%d)!", socket, timeout);
errno = EAGAIN;
result = -1;
goto __exit;
}
@ -699,7 +700,7 @@ __exit:
{
result = recv_len;
at_do_event_changes(sock, AT_EVENT_RECV, RT_FALSE);
errno = 0;
if (!rt_slist_isempty(&sock->recvpkt_list))
{
at_do_event_changes(sock, AT_EVENT_RECV, RT_TRUE);