Remove "atomic" warning for HttpFile

Fixes #945.
This commit is contained in:
Daniel Cantarín 2021-05-25 15:59:53 -03:00 committed by GitHub
parent 056140ae83
commit fe9e26d5d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -287,7 +287,10 @@ bool File::WriteFileAtomically(const char* file_name,
// Skip the warning message for memory files, which is meant for testing // Skip the warning message for memory files, which is meant for testing
// anyway.. // anyway..
if (strncmp(file_name, kMemoryFilePrefix, strlen(kMemoryFilePrefix)) != 0) { // Also check for http files, as they can't do atomic writes.
if (strncmp(file_name, kMemoryFilePrefix, strlen(kMemoryFilePrefix)) != 0
&& strncmp(file_name, kHttpFilePrefix, strlen(kHttpFilePrefix)) != 0
&& strncmp(file_name, kHttpsFilePrefix, strlen(kHttpsFilePrefix)) != 0) {
LOG(WARNING) << "Writing to " << file_name LOG(WARNING) << "Writing to " << file_name
<< " is not guaranteed to be atomic."; << " is not guaranteed to be atomic.";
} }