This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix duration handling in sigtimedwait


---
 winsup/cygwin/signal.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index e581d28da..de3e88697 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -640,6 +640,8 @@ sigtimedwait (const sigset_t *set, siginfo_t *info, const timespec *timeout)
       waittime.QuadPart = (LONGLONG) timeout->tv_sec * NS100PERSEC
                           + ((LONGLONG) timeout->tv_nsec + (NSPERSEC/NS100PERSEC) - 1)
 			    / (NSPERSEC/NS100PERSEC);
+      /* negate waittime to code as duration for NtSetTimer() below cygwait() */
+      waittime.QuadPart = -waittime.QuadPart;
     }
 
   return sigwait_common (set, info, timeout ? &waittime : cw_infinite);
-- 
2.17.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]