mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-27 13:13:20 -08:00
Add umask and rename compatibility wrappers for Windows
umask() doesn't exist on Windows and is thus a no-op. rename() only works if the destination doesn't already exist, so we must unlink before renaming.
This commit is contained in:
committed by
Andrew Ayer
parent
dcea03f0d7
commit
df2b472cd9
@@ -765,7 +765,7 @@ int migrate_key (int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rename(new_key_file_name.c_str(), key_file_name) == -1) {
|
||||
if (util_rename(new_key_file_name.c_str(), key_file_name) == -1) {
|
||||
std::clog << "Error: " << key_file_name << ": " << strerror(errno) << std::endl;
|
||||
unlink(new_key_file_name.c_str());
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user