File locking deprecation replacements (#593)
This commit is contained in:
committed by
GitHub
parent
d1f06cb774
commit
58a529cc44
@@ -70,9 +70,7 @@ void download(
|
||||
|
||||
auto bytes_left = client->getContentLength();
|
||||
|
||||
auto lockable = file::getLock(downloadFilePath);
|
||||
auto lock = lockable->asScopedLock();
|
||||
lock.lock();
|
||||
file::FileMutexGuard guard(downloadFilePath);
|
||||
LOG_I(TAG, "opening %s", downloadFilePath.c_str());
|
||||
auto* file = fopen(downloadFilePath.c_str(), "wb");
|
||||
if (file == nullptr) {
|
||||
|
||||
@@ -186,9 +186,7 @@ size_t receiveFile(httpd_req_t* request, size_t length, const std::string& fileP
|
||||
char buffer[BUFFER_SIZE];
|
||||
size_t bytes_received = 0;
|
||||
|
||||
auto lockable = file::getLock(filePath);
|
||||
auto lock = lockable->asScopedLock();
|
||||
lock.lock();
|
||||
file::FileMutexGuard guard(filePath);
|
||||
|
||||
auto* file = fopen(filePath.c_str(), "wb");
|
||||
if (file == nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user