[CRIU] [PATCH] timerfd: Setup @ticks only if nonzero

Cyrill Gorcunov gorcunov at openvz.org
Tue Sep 16 10:52:13 PDT 2014


If @ticks is zero the kernel returns error
because on creation the @ticks is already zero,
so simply setup @ticks if real value present.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/restorer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pie/restorer.c b/pie/restorer.c
index 11ad57409dac..30fb14395610 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -568,7 +568,8 @@ static int timerfd_arm(struct task_restore_args *args)
 		}
 
 		ret  = sys_timerfd_settime(t->fd, t->settime_flags, &t->val, NULL);
-		ret |= sys_ioctl(t->fd, TFD_IOC_SET_TICKS, (unsigned long)&t->ticks);
+		if (t->ticks)
+			ret |= sys_ioctl(t->fd, TFD_IOC_SET_TICKS, (unsigned long)&t->ticks);
 		if (ret) {
 			pr_err("Can't restore ticks/time for timerfd - %d\n", i);
 			return ret;
-- 
1.9.3



More information about the CRIU mailing list