mirror of https://github.com/openwrt/packages.git
31 lines
1.3 KiB
Diff
31 lines
1.3 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));
|
|
```
|
|
|
|
--- a/src/flb_network.c
|
|
+++ b/src/flb_network.c
|
|
@@ -551,9 +551,6 @@ 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;
|
|
@@ -562,9 +559,6 @@ static int net_connect_async(int fd,
|
|
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;
|