Fix compiler warnings

- implicit declaration of built-in function 'strncpy'
- control reaches end of non-void function
- assignment to 'void (*)(int,  siginfo_t *, void *)' from incompatible pointer type 'void (*)(int)'
This commit is contained in:
Simon Ruderich 2024-05-09 14:37:39 +02:00
parent a42d795002
commit f689c4ec15
2 changed files with 7 additions and 3 deletions

View file

@ -6,6 +6,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include "jsonlogger.h" #include "jsonlogger.h"
@ -81,6 +82,8 @@ static bool dump_var_array_cf(const var_array_cf_t *varray)
} }
LOG_OR_RETURN("]"); LOG_OR_RETURN("]");
return true;
} }

View file

@ -45,9 +45,10 @@ int main()
} }
// ignore SIGPIPE // ignore SIGPIPE
term_action.sa_sigaction = SIG_IGN; struct sigaction term_action_ign = {
.sa_handler = SIG_IGN,
if(sigaction(SIGPIPE, &term_action, NULL) < 0) { };
if(sigaction(SIGPIPE, &term_action_ign, NULL) < 0) {
perror("sigaction"); perror("sigaction");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }