From d954168ddbeb359a13a7afef082cbece33b289c0 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Sat, 19 Dec 2009 00:58:34 +0000 Subject: [PATCH] * signal.cc (nanosleep): Fix bug in previous patch. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/signal.cc | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 113ef7e63..9d0a8db49 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2009-12-18 Eric Blake + + * signal.cc (nanosleep): Fix bug in previous patch. + 2009-12-18 Corinna Vinschen Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 63267da0c..e12f63e2d 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -102,11 +102,11 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp) { /* Divide user's input into transactions no larger than 49.7 days at a time. */ - if (sec > HIRES_DELAY_MAX) + if (sec > HIRES_DELAY_MAX / 1000) { - req = ((HIRES_DELAY_MAX * 1000 + resolution - 1) + req = ((HIRES_DELAY_MAX + resolution - 1) / resolution * resolution); - sec -= HIRES_DELAY_MAX; + sec -= HIRES_DELAY_MAX / 1000; } else {