Skip to content

Commit

Permalink
samples: echo_server: Remove unused error code
Browse files Browse the repository at this point in the history
Remove setting unused error code.

Signed-off-by: Andrei Emeltchenko <[email protected]>
  • Loading branch information
finikorg authored and carlescufi committed Jun 30, 2022
1 parent 82b9282 commit 2a61e30
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions samples/net/sockets/echo_server/src/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,11 @@ static void handle_data(void *ptr1, void *ptr2, void *ptr3)
if (received == 0) {
/* Connection closed */
LOG_INF("TCP (%s): Connection closed", data->proto);
ret = 0;
break;
} else if (received < 0) {
/* Socket error */
LOG_ERR("TCP (%s): Connection error %d", data->proto,
errno);
ret = -errno;
break;
} else {
atomic_add(&data->tcp.bytes_received, received);
Expand All @@ -170,7 +168,6 @@ static void handle_data(void *ptr1, void *ptr2, void *ptr3)
if (ret < 0) {
LOG_ERR("TCP (%s): Failed to send, "
"closing socket", data->proto);
ret = 0;
break;
}

Expand Down

0 comments on commit 2a61e30

Please sign in to comment.