diff --git a/criu/cr-service.c b/criu/cr-service.c index 0672a83db..11ba25390 100644 --- a/criu/cr-service.c +++ b/criu/cr-service.c @@ -1100,7 +1100,7 @@ int cr_service(bool daemon_mode) pr_info("Waiting for connection...\n"); - sk = accept(server_fd, &client_addr, &client_addr_len); + sk = accept(server_fd, (struct sockaddr *)&client_addr, &client_addr_len); if (sk == -1) { pr_perror("Can't accept connection"); goto err; diff --git a/criu/files.c b/criu/files.c index 8c51eaf57..b92101bed 100644 --- a/criu/files.c +++ b/criu/files.c @@ -910,7 +910,7 @@ static int open_transport_fd(int pid, struct fdinfo_list_entry *fle) pr_perror("Can't create socket"); return -1; } - ret = bind(sock, &saddr, sun_len); + ret = bind(sock, (struct sockaddr *)&saddr, sun_len); if (ret < 0) { pr_perror("Can't bind unix socket %s", saddr.sun_path + 1); goto err; diff --git a/criu/fsnotify.c b/criu/fsnotify.c index 4cf2da826..283497606 100644 --- a/criu/fsnotify.c +++ b/criu/fsnotify.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/criu/include/files.h b/criu/include/files.h index 5e3d6dce2..e0b853dc4 100644 --- a/criu/include/files.h +++ b/criu/include/files.h @@ -1,6 +1,8 @@ #ifndef __CR_FILES_H__ #define __CR_FILES_H__ +#include + #include "compiler.h" #include "asm/types.h" #include "fcntl.h" diff --git a/criu/include/syscall-types.h b/criu/include/syscall-types.h index 49798fad4..db0dbc09b 100644 --- a/criu/include/syscall-types.h +++ b/criu/include/syscall-types.h @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "asm/types.h" diff --git a/criu/netfilter.c b/criu/netfilter.c index 7a1ac9191..ab01535a6 100644 --- a/criu/netfilter.c +++ b/criu/netfilter.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include "asm/types.h" diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c index 5262cc89d..492265361 100644 --- a/criu/pie/restorer.c +++ b/criu/pie/restorer.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/criu/sk-unix.c b/criu/sk-unix.c index ca6673ea8..5498718b5 100644 --- a/criu/sk-unix.c +++ b/criu/sk-unix.c @@ -1166,7 +1166,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui) * The below is hack: we use that connect with AF_UNSPEC * clears socket's peer. */ - if (connect(sk, &addr, sizeof(addr.sun_family))) { + if (connect(sk, (struct sockaddr *)&addr, sizeof(addr.sun_family))) { pr_perror("Can't clear socket's peer"); return -1; } diff --git a/lib/c/criu.c b/lib/c/criu.c index e75268cd2..5c65d9fa4 100644 --- a/lib/c/criu.c +++ b/lib/c/criu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "criu.h" #include "rpc.pb-c.h"