pcp
[Top] [All Lists]

Re: [pcp] pmlogger_daily daylight saving change fix and other goodies

To: Nathan Scott <nscott@xxxxxxxxxx>
Subject: Re: [pcp] pmlogger_daily daylight saving change fix and other goodies
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 27 Nov 2008 15:41:47 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <1227739339.4624.41.camel@verge.scott.net.au>
References: <1227690049.2540.13.camel@bozo> <1227739339.4624.41.camel@verge.scott.net.au>
Reply-to: kenj@xxxxxxxxxxxxxxxx
Thanks Nathan.

Yes the _unlock was a little enthusiastic.  The continue is OK as there
is no log files in /var/tmp/pcp/pmlogger to inspect and we should just
fall into the code after this for loop as there are no more arguments
for this for loop ... but break is probably clearer than continue, so
I've made that change also.

The rediffed patch is attached.

On Thu, 2008-11-27 at 09:42 +1100, Nathan Scott wrote:
> On Wed, 2008-11-26 at 20:00 +1100, Ken McDonell wrote:
> > I don't have access to oss.sgi.com yet, so here is another patch that
> > fixes the pmlogger_daily problem with daylight saving transitions.
> 
> Great - I look forward to the next daylight savings switch with
> much less trepidation!
> 
> One question about the changes ...
> 
> @@ -567,10 +530,18 @@ s/^\([A-Za-z][A-Za-z0-9_]*\)=/export \1; \1=/p
>         fqdn=`pmhostname $host`
>         for log in $PCP_TMP_DIR/pmlogger/[0-9]*
>         do
> -           [ "$log" = "[0-9]*" ] && continue
> +           case "$log"
> +           in
> +               *[0-9]*)
> +                   # no pmlogger running according to
> $PCP_TMP_DIR/pmlogger,
> +                   # nothing to be done!
> +                   _unlock
> 
> This _unlock and continue pair looks a bit dubious.  We're going
> to "continue" the inner loop here not the outer one, which means
> we'd potentially prematurely _unlock, wouldn't we?
> 
> +                   continue
> +                   ;;
> +           esac
> 
> 
> cheers.
> 
> --
> Nathan
> 

Attachment: pcp.patch
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>