diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-06-12 10:55:28 +0000 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-06-12 17:30:03 +0000 |
commit | a90e39f896a2f1b76ad3c304b69c451ec92a687a (patch) | |
tree | bb3801066c1f1106e58ff8aa71ccdf94c930a170 | |
parent | 8f33fdc47160edce09d75e1316b4d88129ca60a0 (diff) | |
download | mcelog-a90e39f896a2f1b76ad3c304b69c451ec92a687a.tar.gz |
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 <string.h> 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 <string.h> or explicitly provide a declaration for 'memcmp'
2 errors generated.
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
-rw-r--r-- | client.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -19,6 +19,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <unistd.h> +#include <string.h> #include "mcelog.h" #include "client.h" #include "paths.h" |