This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: patch: sleep/nanosleep bug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 12/17/2009 7:04 AM:
> According to Christopher Faylor on 12/16/2009 9:08 AM:
>>> How about the following, then? Same changelog.
>> It wonder if your while (!done) loop could be expressed as a for loop but
>> it isn't enough of an issue to block inclusion of this patch.
>
>> So, thanks for the patch and please check in. This will then go into 1.7.2.
>
> Thanks; committed now.
And I botched it. I'm pushing this followup as obvious (HIRES_DELAY_MAX
is in ms, not s).
2009-12-18 Eric Blake <ebb9@byu.net>
* signal.cc (nanosleep): Fix bug in previous patch.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkssJQwACgkQ84KuGfSFAYACYwCgx4ae754jxdms7BBIkNTPiK2O
o4wAnRkd86VviazT0jqQJleUjvTZ5Ti8
=epx6
-----END PGP SIGNATURE-----
Index: signal.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/signal.cc,v
retrieving revision 1.89
diff -u -p -r1.89 signal.cc
--- signal.cc 17 Dec 2009 14:04:04 -0000 1.89
+++ signal.cc 19 Dec 2009 00:56:36 -0000
@@ -102,11 +102,11 @@ nanosleep (const struct timespec *rqtp,
{
/* 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
{