From a90e39f896a2f1b76ad3c304b69c451ec92a687a Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Mon, 12 Jun 2023 10:55:28 +0000 Subject: [PATCH] client.c: fix build w/ musl libc Without the patch, I'm getting the following error: client.c:47:2: error: call to undeclared library function 'strncpy' with type 'char *(char *, const char *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] strncpy(sun.sun_path, path, sizeof(sun.sun_path)-1); ^ client.c:47:2: note: include the header or explicitly provide a declaration for 'strncpy' client.c:60:19: error: call to undeclared library function 'memcmp' with type 'int (const void *, const void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (n >= 5 && !memcmp(buf + n - 5, "done\n", 5)) { ^ client.c:60:19: note: include the header or explicitly provide a declaration for 'memcmp' 2 errors generated. Signed-off-by: Brahmajit Das Upstream: https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git/commit/?id=a90e39f896a2f1b76ad3c304b69c451ec92a687a Signed-off-by: Bernd Kuhls --- client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client.c b/client.c index 883b1de..7119ed9 100644 --- a/client.c +++ b/client.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "mcelog.h" #include "client.h" #include "paths.h"