diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 18:06:55 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-12-10 18:06:55 +0000 |
commit | df0884ffb7cd8042ae901793934de281674aa569 (patch) | |
tree | e68f12dd9e91d8176682786b2f96adb863e39a4f | |
parent | 0e480d55537be586c806c8d0175c16a3262daf5c (diff) |
Retry rename operation with a slight delay to workaround problems on
some versions of Windows.
-rw-r--r-- | util/fipsas.pl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/util/fipsas.pl b/util/fipsas.pl index 1694c59a41..2734a20181 100644 --- a/util/fipsas.pl +++ b/util/fipsas.pl @@ -56,7 +56,14 @@ my ($from, $to); unlink $tmptarg; #rename target temporarily -rename($target, $tmptarg) || die "Can't rename $target"; +my $rencnt = 0; +# On windows the previous file doesn't always close straight away +# so retry the rename operation a few times if it fails. +while (!rename($target, $tmptarg)) + { + sleep 2; + die "Can't rename $target" if ($rencnt++ > 10); + } #edit target open(IN,$tmptarg) || die "Can't open temporary file"; |