blob: 8d89e4df354355f62289d2c56297b3971d2b0b28 [file] [log] [blame]
From f645128082117a0152a95b3dccd869a184b7513f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 10 Aug 2022 01:23:48 -0700
Subject: [PATCH 1/2] Use posix strerror_r with musl
Default with glibc is GNU extention of strerror_r
where as musl uses posix variant, call that out
Upstream-Status: Inappropriate [Need wider porting beyond linux/musl/glibc]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/flb_network.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/flb_network.c b/src/flb_network.c
index 992eb1d..5d7a337 100644
--- a/src/flb_network.c
+++ b/src/flb_network.c
@@ -506,7 +506,12 @@ static int net_connect_async(int fd,
}
/* Connection is broken, not much to do here */
+#ifdef __GLIBC__
str = strerror_r(error, so_error_buf, sizeof(so_error_buf));
+#else
+ strerror_r(error, so_error_buf, sizeof(so_error_buf));
+ str = so_error_buf;
+#endif
flb_error("[net] TCP connection failed: %s:%i (%s)",
u->tcp_host, u->tcp_port, str);
return -1;
--
2.37.1