Re: [PATCHv7.1 3/4 (amend)] gitweb: File based caching layer (from git.kernel.org)
On Sun, 28 Nov 2010, Jakub Narebski wrote:
Show 21 quoted lines
> 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