[CRIU] [PATCH] cr: reuse zero_page_entry in fixup_pages_data

Konstantin Khlebnikov khlebnikov at openvz.org
Mon Jan 30 13:36:57 EST 2012


fix compilation error:
cr-restore.c:621:13: error: variably modified ‘zpage’ at file scope

Signed-off-by: Konstantin Khlebnikov <khlebnikov at openvz.org>
---
 cr-restore.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 172bc6b..f9ce3d3 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -618,8 +618,6 @@ static inline bool should_restore_page(int pid, unsigned long va)
 	return si->pid == pid;
 }
 
-static char zpage[PAGE_SIZE];
-
 static int fixup_pages_data(int pid, int fd)
 {
 	int shfd;
@@ -675,9 +673,7 @@ static int fixup_pages_data(int pid, int fd)
 	}
 
 	close(shfd);
-	va = 0;
-	write(fd, &va, sizeof(va));
-	write(fd, zpage, sizeof(zpage));
+	write_img(fd, &zero_page_entry);
 
 	return 0;
 }



More information about the CRIU mailing list