diff options
author | Tristan Gingold <tgingold@free.fr> | 2014-02-01 04:32:51 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2014-02-01 04:32:51 +0100 |
commit | 65f7250d7f0ddbf916758acd1a91d313e57ca0f1 (patch) | |
tree | 5d044fdfb383b17e4bfa14136ef9d5f606cf70ce /libraries.adb | |
parent | a60ee6981330604152d73f023140c1d30a0c52e1 (diff) | |
download | ghdl-65f7250d7f0ddbf916758acd1a91d313e57ca0f1.tar.gz ghdl-65f7250d7f0ddbf916758acd1a91d313e57ca0f1.tar.bz2 ghdl-65f7250d7f0ddbf916758acd1a91d313e57ca0f1.zip |
Windows: fix library update, handle errors during elaboration.
Diffstat (limited to 'libraries.adb')
-rw-r--r-- | libraries.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libraries.adb b/libraries.adb index 0b07dc32b..e0306f42d 100644 --- a/libraries.adb +++ b/libraries.adb @@ -1287,8 +1287,11 @@ package body Libraries is & Back_End.Library_To_File_Name (Library); Delete_Success : Boolean; begin + -- For windows: renames doesn't overwrite destination; so first + -- delete it. This can create races condition on Unix: if the + -- program is killed between delete and rename, the library is lost. + Delete_File (File_Name, Delete_Success); Rename_File (Temp_Name.all, File_Name, Success); - Delete_File (Temp_Name.all, Delete_Success); Free (Temp_Name); if not Success then Error_Msg ("cannot update library file """ & File_Name & """"); |