aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-01-29 02:09:54 +0800
committerjoe <joe@FreeBSD.org>2001-01-29 02:09:54 +0800
commita2b9c19ee7431108c516d4a9617b27f6e56f13f4 (patch)
tree521c16ebc9dcef38d3a5e3a657f6becc6e5269f2 /CVSROOT
parent0e0230914a71273db44ecd7fc5d408478ef1a20e (diff)
downloadfreebsd-ports-gnome-a2b9c19ee7431108c516d4a9617b27f6e56f13f4.tar.gz
freebsd-ports-gnome-a2b9c19ee7431108c516d4a9617b27f6e56f13f4.tar.zst
freebsd-ports-gnome-a2b9c19ee7431108c516d4a9617b27f6e56f13f4.zip
Changes to the cleanup_tmpfiles routine:
* local -> my. * Don't chdir to /tmp. * Use $TMPDIR to file the temporary files. * Don't delete the temporary files if we're in debug mode.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/log_accum.pl17
1 files changed, 9 insertions, 8 deletions
diff --git a/CVSROOT/log_accum.pl b/CVSROOT/log_accum.pl
index d4c187c19fd4..1600dd7ebf90 100755
--- a/CVSROOT/log_accum.pl
+++ b/CVSROOT/log_accum.pl
@@ -110,17 +110,18 @@ my $CVSROOT = $ENV{'CVSROOT'} || "/home/ncvs";
############################################################
sub cleanup_tmpfiles {
- local($wd, @files);
+ my @files; # The list of temporary files.
+
+ # Don't clean up afterwards if in debug mode.
+ return if $DEBUG;
+
+ opendir DIR, $TMPDIR or die "Cannot open directory: $TMPDIR!";
+ push @files, grep /^$FILE_PREFIX\..*$PID$/, readdir(DIR);
+ closedir DIR;
- $wd = `pwd`;
- chdir("/tmp");
- opendir(DIR, ".");
- push(@files, grep(/^$FILE_PREFIX\..*$PID$/, readdir(DIR)));
- closedir(DIR);
foreach (@files) {
- unlink $_;
+ unlink "$TMPDIR/$_";
}
- chdir($wd);
}
sub append_to_logfile {