From c8e0e909b4a8d18319fc65434a10dc446434817c Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:19:49 +0200 Subject: 5.3 --- zen/file_update_handle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zen/file_update_handle.h') diff --git a/zen/file_update_handle.h b/zen/file_update_handle.h index aa9edebd..716048fd 100644 --- a/zen/file_update_handle.h +++ b/zen/file_update_handle.h @@ -24,7 +24,7 @@ public: const DWORD lastError = ::GetLastError(); if (lastError == ERROR_ACCESS_DENIED) //function fails if file is read-only { - zen::ScopeGuard guardErrorCode = zen::makeGuard([&]() { ::SetLastError(lastError); }); //transactional behavior: ensure cleanup (e.g. network drop) -> cref [!] + //zen::ScopeGuard guardErrorCode = zen::makeGuard([&] { ::SetLastError(lastError); }); //transactional behavior: ensure cleanup (e.g. network drop) -> cref [!] //read-only file attribute may cause trouble: temporarily reset it const DWORD tmpAttr = ::GetFileAttributes(filenameFmt.c_str()); @@ -32,7 +32,7 @@ public: { if (::SetFileAttributes(filenameFmt.c_str(), FILE_ATTRIBUTE_NORMAL)) { - guardErrorCode.dismiss(); + //guardErrorCode.dismiss(); attr = tmpAttr; //"create" guard on read-only attribute //now try again -- cgit