blob: 8d89e4df354355f62289d2c56297b3971d2b0b28 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From f645128082117a0152a95b3dccd869a184b7513f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 10 Aug 2022 01:23:48 -0700
4Subject: [PATCH 1/2] Use posix strerror_r with musl
5
6Default with glibc is GNU extention of strerror_r
7where as musl uses posix variant, call that out
8
9Upstream-Status: Inappropriate [Need wider porting beyond linux/musl/glibc]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/flb_network.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/src/flb_network.c b/src/flb_network.c
16index 992eb1d..5d7a337 100644
17--- a/src/flb_network.c
18+++ b/src/flb_network.c
19@@ -506,7 +506,12 @@ static int net_connect_async(int fd,
20 }
21
22 /* Connection is broken, not much to do here */
23+#ifdef __GLIBC__
24 str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
25+#else
26+ strerror_r(error, so_error_buf, sizeof(so_error_buf));
27+ str = so_error_buf;
28+#endif
29 flb_error("[net] TCP connection failed: %s:%i (%s)",
30 u->tcp_host, u->tcp_port, str);
31 return -1;
32--
332.37.1
34