Update of /cvsroot/lxr/lxr/lib/LXR/Files
In directory usw-pr-cvs1:/tmp/cvs-serv1082/lib/LXR/Files
Modified Files:
CVS.pm Plain.pm
Log Message:
Fix tmpfile duplication a better way, make both file access methods honour
the setting of $config->tmpdir
Index: CVS.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/CVS.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- CVS.pm 2001/08/15 15:50:27 1.16
+++ CVS.pm 2002/02/03 08:22:08 1.17
@@ -189,7 +189,7 @@
$buf = $self->getfile($filename, $release);
return undef unless defined($buf);
- $tmp = '/tmp/lxrtmp.'.time.'.'.$$.'.'.&LXR::Common::tmpcounter;
+ $tmp = $config->tmpdir.'/lxrtmp.'.time.'.'.$$.'.'.&LXR::Common::tmpcounter;
open(TMP, "> $tmp") || return undef;
print(TMP $buf);
close(TMP);
Index: Plain.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/Plain.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Plain.pm 2002/02/03 08:12:53 1.17
+++ Plain.pm 2002/02/03 08:22:08 1.18
@@ -78,12 +78,7 @@
my ($tmp, $tries);
local ($/) = undef;
- $tmp = $config->tmpdir.'/lxrtmp.'.time.'.'.$$;
- $tries=0;
- while ( -e $tmp.$tries) {
- $tries++;
- }
- $tmp.=$tries;
+ $tmp = $config->tmpdir.'/lxrtmp.'.time.'.'.$$.'.'.&LXR::Common::tmpcounter;
open(TMP, "> $tmp") || return undef;
open(FILE, $self->toreal($filename, $release)) || return undef;
print(TMP <FILE>);
|