Skip to content

Commit

Permalink
network: restored patch I accidentally removed
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich committed Mar 13, 2024
1 parent cd55774 commit cf7fac3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/flb_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,20 @@ static int net_connect_async(int fd,
}

/* Connection is broken, not much to do here */
#if ((defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
(defined(_XOPEN_SOURCE) || _XOPEN_SOURCE - 0L >= 600L)) && \
(!defined(_GNU_SOURCE))
ret = strerror_r(error, so_error_buf, sizeof(so_error_buf));
if (ret == 0) {
str = so_error_buf;
}
else {
flb_errno();
return -1;
}
#else
str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
#endif
flb_error("[net] TCP connection failed: %s:%i (%s)",
u->tcp_host, u->tcp_port, str);
return -1;
Expand Down

0 comments on commit cf7fac3

Please sign in to comment.