[CRIU] [PATCH 2/2] criu: a few fixes to build on Alpine

Andrey Vagin avagin at openvz.org
Tue Jul 5 11:45:35 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/fsnotify.c   |  3 ++-
 criu/page-pipe.c  |  2 +-
 criu/proc_parse.c | 13 +++++++++++++
 criu/uffd.c       |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/criu/fsnotify.c b/criu/fsnotify.c
index 2834976..022aed8 100644
--- a/criu/fsnotify.c
+++ b/criu/fsnotify.c
@@ -41,6 +41,7 @@
 #include "namespaces.h"
 #include "pstree.h"
 #include "fault-injection.h"
+#include "syscall-codes.h"
 
 #include "protobuf.h"
 #include "images/fsnotify.pb-c.h"
@@ -104,7 +105,7 @@ static void decode_handle(fh_t *handle, FhEntry *img)
 
 static int open_by_handle(void *arg, int fd, int pid)
 {
-	return open_by_handle_at(fd, arg, O_PATH);
+	return syscall(__NR_open_by_handle_at, fd, arg, O_PATH);
 }
 
 static char *alloc_openable(unsigned int s_dev, unsigned long i_ino, FhEntry *f_handle)
diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index c4a63d1..ed6f2ad 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -454,7 +454,7 @@ int page_pipe_split(struct page_pipe *pp, unsigned long addr,
 	 * the part after addr + requested pages to a separate iov
 	 */
 	len = min((unsigned long)iov->iov_base + iov->iov_len - addr,
-		  *nr_pages * PAGE_SIZE);
+		  (unsigned long)(*nr_pages) * PAGE_SIZE);
 	ret = page_pipe_split_iov(pp, ppb, iov, addr + len, true);
 	if (ret)
 		return -1;
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index 3677e4a..c25077d 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -41,6 +41,19 @@
 
 #include <stdlib.h>
 
+#ifndef SIGEV_SIGNAL
+#define SIGEV_SIGNAL    0       /* notify via signal */
+#endif
+#ifndef SIGEV_NONE
+#define SIGEV_NONE      1       /* other notification: meaningless */
+#endif
+#ifndef SIGEV_THREAD
+#define SIGEV_THREAD    2       /* deliver via thread creation */
+#endif
+#ifndef SIGEV_THREAD_ID
+#define SIGEV_THREAD_ID 4       /* deliver to thread */
+#endif
+
 struct buffer {
 	char buf[PAGE_SIZE];
 	char end; /* '\0' */
diff --git a/criu/uffd.c b/criu/uffd.c
index 6c9b141..8fe8e18 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -278,7 +278,7 @@ static struct lazy_pages_info *ud_open(int listen, struct sockaddr_un *saddr)
 
 	/* accept new client request */
 	len = sizeof(struct sockaddr_un);
-	if ((client = accept(listen, saddr, &len)) < 0) {
+	if ((client = accept(listen, (struct sockaddr *) saddr, &len)) < 0) {
 		pr_perror("server_accept error: %d", client);
 		close(listen);
 		return NULL;
-- 
2.7.4



More information about the CRIU mailing list