This is the mail archive of the cygwin-cvs@cygwin.com 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]

[newlib-cygwin] fix duration handling in sigtimedwait


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3e51cc478d25eabb253c11c2d9c9655deff25c97

commit 3e51cc478d25eabb253c11c2d9c9655deff25c97
Author: Mark Geisert <mark@maxrnd.com>
Date:   Thu Jul 19 02:35:40 2018 -0700

    fix duration handling in sigtimedwait

Diff:
---
 winsup/cygwin/release/2.11.0 | 3 +++
 winsup/cygwin/signal.cc      | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/winsup/cygwin/release/2.11.0 b/winsup/cygwin/release/2.11.0
index 9e73e0a..85cf8b2 100644
--- a/winsup/cygwin/release/2.11.0
+++ b/winsup/cygwin/release/2.11.0
@@ -44,3 +44,6 @@ Bug Fixes
 - Handle a non-standard return value from some tape drives to
   report a "no-media" error.
   Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00245.html
+
+- Fix duration handling in sigtimedwait
+  Addresses: https://cygwin.com/ml/cygwin-patches/2018-q3/msg00018.html
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index e581d28..de3e886 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);


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