From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Mon, 29 Aug 2011 15:20:43 +0200 Subject: [Cluster-devel] bug in cman/init.d/cman.in? In-Reply-To: <24E144B8C0207547AD09C467A8259F75377CB6C6@lisa.maurer-it.com> References: <24E144B8C0207547AD09C467A8259F75377CB457@lisa.maurer-it.com> <4E5B80B1.4020708@redhat.com> <24E144B8C0207547AD09C467A8259F75377CB6C6@lisa.maurer-it.com> Message-ID: <4E5B922B.6080009@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 08/29/2011 03:14 PM, Dietmar Maurer wrote: > This is a bug fix. I got wrong results. Ok, unless you have strong objections I prefer to rename the variable completely in status() to avoid confusion and fix the issue. > > Besides it does not lock sane to overwrite that global variable there (why?). Simple overlook. I agree a fix is required, I simply wasn't sure if you were hitting a bug or not since I couldn't spot the error in the code. Fabio > > - Dietmar > >> -----Original Message----- >> From: cluster-devel-bounces at redhat.com [mailto:cluster-devel- >> bounces at redhat.com] On Behalf Of Fabio M. Di Nitto >> Sent: Montag, 29. August 2011 14:06 >> To: cluster-devel at redhat.com >> Subject: Re: [Cluster-devel] bug in cman/init.d/cman.in? >> >> On 08/29/2011 10:44 AM, Dietmar Maurer wrote: >>> * do not overwrite global return status 'rtrn' - use local keyword >>> >>> Index: new/cman/init.d/cman.in >>> >> ================================================================= >> == >>> --- new.orig/cman/init.d/cman.in 2010-12-02 07:19:35.000000000 +0100 >>> +++ new/cman/init.d/cman.in 2010-12-23 11:32:12.000000000 +0100 >>> @@ -46,7 +48,7 @@ >>> status() >>> { >>> pid=$(pidof $1 2>/dev/null) >>> - rtrn=$? >>> + local rtrn=$? >>> if [ $rtrn -ne 0 ]; then >>> echo "$1 is stopped" >>> else >>> >>> >> >> Is this purely semantic or are you actually fixing a bug? >> >> Reading the code, it doesn't look like it makes any difference... but I might not >> see it right. >> >> Fabio >> > >