From: Jakub Narebski Date: Sun, 28 Nov 2010 11:31:46 GMT Subject: Re: [PATCHv7.1 3/4 (amend)] gitweb: File based caching layer (from git.kernel.org) Message-ID: <201011281231.46786.jnareb@gmail.com> In-Reply-To: <201011281223.03141.jnareb@gmail.com> On Sun, 28 Nov 2010, Jakub Narebski wrote: > On Sat, 13 Nov 2010, Jakub Narebski wrote: > > > +sub cacheUpdate { > > +       my ($action,$areForked) = @_; > > +       my $lockingStatus; > > +       my $fileData = ""; > > + > > +       if($backgroundCache){ > > +               open(cacheFileBG, '>:utf8', "$fullhashpath.bg"); > > +               my $lockStatBG = flock(cacheFileBG,LOCK_EX|LOCK_NB); > > + > > +               $lockStatus = $lockStatBG; > > +       }else{ > > +               open(cacheFile, '>:utf8', \$fullhashpath); >                                             ^^^^^^^^^^^^^^ > > I have made mistake with this line when moving $caching_enabled check > out of cache_fetch to its caller. > > Reusing $fullhashpath variable as a *capture buffer* (it has nothing > to do with path; it is not a filename no longer) wouldn't help there. Errr... I meant that this abuse didn't help avoiding my mistake. -- Jakub Narebski Poland