Skip to content

Commit

Permalink
Merge pull request #341 from lealem47/zd16386
Browse files Browse the repository at this point in the history
Fix for declaration after executable block
  • Loading branch information
embhorn committed Jul 6, 2023
2 parents a501fa2 + 0c68758 commit 21954d5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/mqttnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,10 @@ static int NetConnect(void *context, const char* host, word16 port,
/* set default error case */
rc = MQTT_CODE_ERROR_NETWORK;
#ifdef WOLFMQTT_NONBLOCK
/* Check for error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
{
/* Check for error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
}
if (
#ifndef _WIN32
(errno == EINPROGRESS) ||
Expand Down Expand Up @@ -681,8 +683,10 @@ static int NetWrite(void *context, const byte* buf, int buf_len,

rc = (int)SOCK_SEND(sock->fd, buf, buf_len, 0);
if (rc == -1) {
/* Get error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
{
/* Get error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
}
if (so_error == 0) {
#if defined(USE_WINDOWS_API) && defined(WOLFMQTT_NONBLOCK)
/* assume non-blocking case */
Expand Down Expand Up @@ -846,8 +850,10 @@ static int NetRead_ex(void *context, byte* buf, int buf_len,
rc = MQTT_CODE_ERROR_TIMEOUT;
}
else if (rc < 0) {
/* Get error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
{
/* Get error */
GET_SOCK_ERROR(sock->fd, SOL_SOCKET, SO_ERROR, so_error);
}
if (so_error == 0) {
rc = 0; /* Handle signal */
}
Expand Down

0 comments on commit 21954d5

Please sign in to comment.