[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg s-s-d --retry --pidfile changes



Hi,

On Fri, 2008-01-25 at 12:10:41 -0500, Justin Pryzby wrote:
> In debian/changelog for dpkg-1.14.16.3:
> | * Fix timeout computations for start-stop-daemon --retry option. This has
> |   not worked properly for a long time (maybe never), but came to light
> |   due to #460903's fix. Closes: #462104
> 
> In utils/start-stop-daemon.c (the ! are mine):
> |static void
> |tmul(struct timeval *a, int b)
> |{
> |        a->tv_sec *= b;
> !        fprintf(stderr, "%d, %ld\n", b, a->tv_usec);
> !        assert(a->tv_usec<2000000./b);
> |        a->tv_usec *= b;
> !        assert(a->tv_usec<2000000);
> |        if (a->tv_usec >= 1000000) {
> |                ++a->tv_sec;
> |                a->tv_usec -= 1000000;
> |        }
> !        assert(a->tv_usec<1000000);
> |}
> 
> I wonder whether that "if()" should be a "while()" since b (aka ratio) is
> initialized to 1 and incremented (although the comments state that it is
> initialized to 2).

The whole normalization part is bogus, that was a stupid mistake on my
part, I was probably thinking about addition not multiplication. It's
fixed now in the git tree [0], targetted for .17.

thanks,
guillem

[0] http://git.debian.org/?p=dpkg/dpkg.git;a=commitdiff;h=d899367f


Reply to: