Commit 8f2cb6b2 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 6dc00746
...@@ -568,7 +568,8 @@ static int timerfd_arm(struct task_restore_args *args) ...@@ -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_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) { if (ret) {
pr_err("Can't restore ticks/time for timerfd - %d\n", i); pr_err("Can't restore ticks/time for timerfd - %d\n", i);
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment