Front page | perl.perl5.porters |
Postings from May 2008
Re: [perl #53962] bug in Time::HiRes 5.11
Thread Previous
From:
Reini Urban
Date:
May 12, 2008 06:08
Subject:
Re: [perl #53962] bug in Time::HiRes 5.11
Message ID:
48284111.8010101@x-ray.at
Dmitry Karasik schrieb:
> On 11 май 08 at 15:32, "Dominic" (Dominic Dunlop) wrote:
>
> Dominic> On 2008√05√10, at 21:04, dk@tetsuo.karasik.eu.org (via RT) wrote:
> >> I don't have access to perl's source repositary
> Dominic> The file, with line-by-line blame, should be visible to you at
> Dominic> <http://public.activestate.com/cgi-bin/perlbrowse/b/ext/Time/HiRes/HiRes.xs
> >> . On brief examination, the check-in comments seem to do a good job
> Dominic> of saying why particular changes were made.
>
> Ah, excellent. That did it - so there indeed was an explanation why timeouts
> less than one second were implemented using setitimer(), and otherwise
> using ualarm(). I've reworked the patch, so the time limit check stays, but
> only for ualarm() case, and doesn't mix with the setitimer() logic.
That patch didn't fix my ongoing cygwin blead failures.
ext/Time/HiRes/t/HiRes........................................FAILED--non-zero
wait status: 15
same error before and after.
> --- HiRes.xs.0 2008-05-10 20:02:23.000000000 +0200
> +++ HiRes.xs 2008-05-11 18:44:53.000000000 +0200
> @@ -925,7 +925,6 @@
> CODE:
> if (useconds < 0 || uinterval < 0)
> croak("Time::HiRes::ualarm(%d, %d): negative time not invented yet", useconds, uinterval);
> - if (useconds >= IV_1E6 || uinterval >= IV_1E6)
> #if defined(HAS_SETITIMER) && defined(ITIMER_REAL)
> {
> struct itimerval itv;
> @@ -936,10 +935,10 @@
> }
> }
> #else
> + if (useconds >= IV_1E6 || uinterval >= IV_1E6)
> croak("Time::HiRes::ualarm(%d, %d): useconds or uinterval equal to or more than %"IVdf, useconds, uinterval, IV_1E6);
> + RETVAL = ualarm(useconds, uinterval);
> #endif
> - else
> - RETVAL = ualarm(useconds, uinterval);
>
> OUTPUT:
> RETVAL
> @@ -954,7 +953,6 @@
> {
> IV useconds = IV_1E6 * seconds;
> IV uinterval = IV_1E6 * interval;
> - if (seconds >= IV_1E6 || interval >= IV_1E6)
> #if defined(HAS_SETITIMER) && defined(ITIMER_REAL)
> {
> struct itimerval itv;
> @@ -965,8 +963,9 @@
> }
> }
> #else
> - RETVAL = (NV)ualarm((IV)(seconds * IV_1E6),
> - (IV)(interval * IV_1E6)) / NV_1E6;
> + if (useconds >= IV_1E6 || uinterval >= IV_1E6)
> + croak("Time::HiRes::alarm(%d, %d): seconds or interval equal to or more than 1.0 ", useconds, uinterval, IV_1E6);
> + RETVAL = (NV)ualarm( useconds, uinterval) / NV_1E6;
> #endif
> }
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
Thread Previous