[CRIU] [PATCH 2/4] restore: Simplify prepare_itimers

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 17 05:08:48 EST 2012


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 8208509..d1eb802 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1582,14 +1582,9 @@ static int prepare_itimers(int pid, struct task_restore_core_args *args)
 		return fd;
 
 	if (read_img_buf(fd, ie, sizeof(ie)) > 0) {
-		ret = itimer_restore_and_fix("real",
-				&ie[0], &args->itimers[0]);
-		if (!ret)
-			ret = itimer_restore_and_fix("virt",
-					&ie[1], &args->itimers[1]);
-		if (!ret)
-			ret = itimer_restore_and_fix("prof",
-					&ie[2], &args->itimers[2]);
+		ret  = itimer_restore_and_fix("real", &ie[0], &args->itimers[0]);
+		ret |= itimer_restore_and_fix("virt", &ie[1], &args->itimers[1]);
+		ret |= itimer_restore_and_fix("prof", &ie[2], &args->itimers[2]);
 	}
 
 	close(fd);
-- 
1.7.7.6



More information about the CRIU mailing list