diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2014-09-16 21:52:00 +0400 |
---|---|---|
committer | Pavel Emelyanov <xemul@parallels.com> | 2014-09-22 12:21:58 +0400 |
commit | c948c8bc3a3f1d645afb4ec43ac544138bd29fe4 (patch) | |
tree | d88ac052d311bdf6755cfb02de41ddf2a63f2874 | |
parent | 725dfccfa6bcfb045335e02f921620f2f69367cb (diff) |
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>
-rw-r--r-- | pie/restorer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pie/restorer.c b/pie/restorer.c index 11ad57409..30fb14395 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; |