2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

timerfd: Setup @ticks only if nonzero

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@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2014-09-16 21:52:00 +04:00 committed by Pavel Emelyanov
parent 725dfccfa6
commit c948c8bc3a

View File

@ -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;