[CRIU] [PATCH 05/16] restore: don't add unneeded vma with zero start and end addresses

Andrey Vagin avagin at openvz.org
Wed Nov 14 12:19:14 EST 2012


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 1dfe833..276cf49 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -194,12 +194,13 @@ static int read_vmas(int pid, struct list_head *vmas, int *nr_vmas)
 		if (!vma)
 			break;
 
-		(*nr_vmas)++;
-		list_add_tail(&vma->list, vmas);
 		ret = pb_read_one_eof(fd, &e, PB_VMAS);
 		if (ret <= 0)
 			break;
 
+		(*nr_vmas)++;
+		list_add_tail(&vma->list, vmas);
+
 		if (e->fd != -1) {
 			ret = -1;
 			pr_err("Error in vma->fd setting (%Ld)\n",
-- 
1.7.11.7



More information about the CRIU mailing list