Commit ef62a97e authored by simonmar's avatar simonmar
Browse files

[project @ 2000-05-11 13:30:11 by simonmar]

Try to avoid clashes with files already in $TMPDIR.
parent 0eb4bba1
......@@ -158,7 +158,14 @@ $SIG{'QUIT'} = 'quit_upon_signal';
: "$TopPwd/${CURRENT_DIR}" );
if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
$Tmp_prefix = ($ENV{'TMPDIR'} . "/ghc$$");
# Try to find a $Tmp_prefix which isn't being used...
$tmp = $$;
do {
$Tmp_prefix = ($ENV{'TMPDIR'} . "/ghc$tmp");
$tmp++;
} while ( -e "$Tmp_prefix.hc" ||
-e "$Tmp_Prefix.s" ||
-e "$Tmp_Prefix.hi" );
} else {
print STDERR "TMPDIR has not been set to anything useful!\n" if (${TMPDIR} eq '');
$Tmp_prefix ="${TMPDIR}/ghc$$"; # TMPDIR set via Makefile when booting..
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment