From a3268ac392241830cf6c91abe663f252c407cf8c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 21 Jan 2019 00:14:51 +0100 Subject: [PATCH] Cygwin: timerfd: Handle gettime error in settime Signed-off-by: Corinna Vinschen --- winsup/cygwin/timerfd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc index 4f04efd13..e5c17fb4e 100644 --- a/winsup/cygwin/timerfd.cc +++ b/winsup/cygwin/timerfd.cc @@ -590,8 +590,8 @@ timerfd_tracker::settime (int flags, const struct itimerspec *new_value, ret = -EBADF; __leave; } - if (old_value) - gettime (old_value); + if (old_value && (ret = gettime (old_value)) < 0) + __leave; if (new_value->it_value.tv_sec == 0 && new_value->it_value.tv_nsec == 0) ret = disarm_timer (); else