diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-02-22 01:54:41 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-02-22 11:43:58 +0100 |
| commit | e52aa52a664b602a8917e69f6db4aefc6258f46c (patch) | |
| tree | 5a01d76ceed06c488ff6a19e394cf13b6367e5bc /Source/Core/UpdaterCommon/UpdaterCommon.cpp | |
| parent | 3c4a21315d14fbc8c492b86b4d2dec13bc648a01 (diff) | |
Common/FileUtil: Rename Copy() to CopyRegularFile().
This is to clarify that it can only copy files, not folders.
Diffstat (limited to 'Source/Core/UpdaterCommon/UpdaterCommon.cpp')
| -rw-r--r-- | Source/Core/UpdaterCommon/UpdaterCommon.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/UpdaterCommon/UpdaterCommon.cpp b/Source/Core/UpdaterCommon/UpdaterCommon.cpp index 6fdb9630a0..f16354421d 100644 --- a/Source/Core/UpdaterCommon/UpdaterCommon.cpp +++ b/Source/Core/UpdaterCommon/UpdaterCommon.cpp @@ -433,12 +433,12 @@ bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update, // Unfortunately, there is a quirk in the kernel with how it handles the cache: if the file is // simply overwritten, the cache isn't invalidated and the old code signature is used to verify // the new file. This causes macOS to kill the process with a code signing error. To workaround - // this, we use File::Rename() instead of File::Copy(). However, this also means that if two - // files have the same hash, the first file will succeed, but the second file will fail because - // the source file no longer exists. To deal with this, we copy the content file to a temporary - // file and then rename the temporary file to the destination path. + // this, we use File::Rename() instead of File::CopyRegularFile(). However, this also means that + // if two files have the same hash, the first file will succeed, but the second file will fail + // because the source file no longer exists. To deal with this, we copy the content file to a + // temporary file and then rename the temporary file to the destination path. const std::string temporary_file = temp_path + DIR_SEP + "temporary_file"; - if (!File::Copy(temp_path + DIR_SEP + content_filename, temporary_file)) + if (!File::CopyRegularFile(temp_path + DIR_SEP + content_filename, temporary_file)) { fprintf(log_fp, "Could not copy %s to %s.\n", content_filename.c_str(), temporary_file.c_str()); @@ -447,7 +447,7 @@ bool UpdateFiles(const std::vector<TodoList::UpdateOp>& to_update, if (!File::Rename(temporary_file, path)) #else - if (!File::Copy(temp_path + DIR_SEP + content_filename, path)) + if (!File::CopyRegularFile(temp_path + DIR_SEP + content_filename, path)) #endif { fprintf(log_fp, "Could not update file %s.\n", op.filename.c_str()); |
