summaryrefslogtreecommitdiff
path: root/t/run/cloexec.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-08-08 09:59:45 +0000
committerNicholas Clark <nick@ccl4.org>2008-08-08 09:59:45 +0000
commit2d90ac9586ffb5c785730411e7c6e986a8a1190c (patch)
tree65631403310e339f040a6f18f66ede394a8e48ef /t/run/cloexec.t
parent16570ae7eebaecacdda358922298468d022f241d (diff)
downloadperl-2d90ac9586ffb5c785730411e7c6e986a8a1190c.tar.gz
Convert all unimaginative (ie race condition) temporary file names to
use test.pl's tempfile(). p4raw-id: //depot/perl@34184
Diffstat (limited to 't/run/cloexec.t')
-rw-r--r--t/run/cloexec.t12
1 files changed, 3 insertions, 9 deletions
diff --git a/t/run/cloexec.t b/t/run/cloexec.t
index cfbe702a08..dfbae3ad9c 100644
--- a/t/run/cloexec.t
+++ b/t/run/cloexec.t
@@ -67,9 +67,9 @@ sub make_tmp_file {
my $Perl = which_perl();
my $quote = $Is_VMS || $Is_Win32 ? '"' : "'";
-my $tmperr = 'cloexece.tmp';
-my $tmpfile1 = 'cloexec1.tmp';
-my $tmpfile2 = 'cloexec2.tmp';
+my $tmperr = tempfile();
+my $tmpfile1 = tempfile();
+my $tmpfile2 = tempfile();
my $tmpfile1_contents = "tmpfile1 line 1\ntmpfile1 line 2\n";
my $tmpfile2_contents = "tmpfile2 line 1\ntmpfile2 line 2\n";
make_tmp_file($tmpfile1, $tmpfile1_contents);
@@ -164,9 +164,3 @@ cmp_ok( $parentfd1, '<=', $^F, "parent open fd=$parentfd1 (\$^F=$^F)" );
test_inherited($parentfd1);
close FHPARENT1 or die "close '$tmpfile1': $!";
close FHPARENT2 or die "close '$tmpfile2': $!";
-
-END {
- defined $tmperr and unlink($tmperr);
- defined $tmpfile1 and unlink($tmpfile1);
- defined $tmpfile2 and unlink($tmpfile2);
-}