alpine-overlay/kubezero/fluent-bit/musl-strerror_r.patch

36 lines
1.4 KiB
Diff

Fix -Wint-conversion error with gcc 14 due to musl using POSIX strerror_r.
```
/home/build/aports/testing/fluent-bit/src/fluent-bit-3.1.9/src/flb_network.c: In function 'net_connect_async':
/home/build/aports/testing/fluent-bit/src/fluent-bit-3.1.9/src/flb_network.c:566:17: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
566 | str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
```
--- fluent-bit-3.1.9-origin/src/flb_network.c
+++ fluent-bit-3.1.9/src/flb_network.c
@@ -549,24 +549,18 @@
if (u_conn->net_error > 0) {
error = u_conn->net_error;
}
/* 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;
}
}