diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 13:29:38 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 13:29:38 +0000 |
commit | 67ef4f63f1fcedc7202a721007e9aac29133a668 (patch) | |
tree | 4ccea387d86ef896da794be40f4978d2012d316b /util/fipsas.pl | |
parent | 3bfe583b8dcf3c3841ca0f6c2bd391f647e48dd8 (diff) | |
download | openssl-67ef4f63f1fcedc7202a721007e9aac29133a668.tar.gz |
use different names for asm temp files to avoid problems on some platforms
Diffstat (limited to 'util/fipsas.pl')
-rw-r--r-- | util/fipsas.pl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/util/fipsas.pl b/util/fipsas.pl index fc2a759308..1694c59a41 100644 --- a/util/fipsas.pl +++ b/util/fipsas.pl @@ -8,6 +8,9 @@ my @ARGS = @ARGV; my $top = shift @ARGS; my $target = shift @ARGS; +my $tmptarg = $target; + +$tmptarg =~ s/\.[^\\\/\.]+$/.tmp/; my $runasm = 1; @@ -48,11 +51,15 @@ while (<IN>) my ($from, $to); +#delete any temp file lying around + +unlink $tmptarg; + #rename target temporarily -rename($target, "tmptarg.s") || die "Can't rename $target"; +rename($target, $tmptarg) || die "Can't rename $target"; #edit target -open(IN,"tmptarg.s") || die "Can't open temporary file"; +open(IN,$tmptarg) || die "Can't open temporary file"; open(OUT, ">$target") || die "Can't open output file $target"; while (<IN>) @@ -75,16 +82,12 @@ if ($runasm) # restore target unlink $target; - rename "tmptarg.s", $target; + rename $tmptarg, $target; die "Error executing assembler!" if $rv != 0; } else { # Don't care about target - unlink "tmptarg.s"; + unlink $tmptarg; } - - - - |