--- src/flb_network.c 2025-03-25 06:35:10.000000000 +0800 +++ src/flb_network.c 2025-07-26 13:33:47.000000000 +0800 @@ -308,18 +308,21 @@ */ int flb_net_socket_tcp_keepalive(flb_sockfd_t fd, struct flb_net_setup *net) { - int interval; int enabled; - int probes; int time; int ret; +#ifndef __APPLE__ + int interval; + int probes; +#endif enabled = 1; time = net->tcp_keepalive_time; +#ifndef __APPLE__ probes = net->tcp_keepalive_probes; interval = net->tcp_keepalive_interval; - +#endif ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *) &enabled, sizeof(enabled)); @@ -330,7 +333,7 @@ ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, #endif (const void *) &time, sizeof(time)); } - +#ifndef __APPLE__ if (ret == 0 && interval >= 0) { ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, (const void *) &interval, sizeof(interval)); @@ -340,7 +343,7 @@ ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, (const void *) &probes, sizeof(probes)); } - +#endif if (ret != 0) { flb_error("[net] failed to configure TCP keepalive for connection #%i", fd);