summaryrefslogtreecommitdiff
path: root/library/lock_holder.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:13:13 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:13:13 +0200
commit7f23ee90fd545995a29e2175f15e8b97e59ca67a (patch)
treef8d0afac51995032e58b9a475ccbbc73ba207baf /library/lock_holder.h
parent3.19 (diff)
downloadFreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.tar.gz
FreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.tar.bz2
FreeFileSync-7f23ee90fd545995a29e2175f15e8b97e59ca67a.zip
3.20
Diffstat (limited to 'library/lock_holder.h')
-rw-r--r--library/lock_holder.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/lock_holder.h b/library/lock_holder.h
index dc88ce71..172209dc 100644
--- a/library/lock_holder.h
+++ b/library/lock_holder.h
@@ -5,6 +5,7 @@
#include "../shared/zstring.h"
#include "dir_lock.h"
#include "status_handler.h"
+#include "dir_exist_async.h"
namespace zen
{
@@ -16,7 +17,10 @@ class LockHolder
public:
void addDir(const Zstring& dirnameFmt, ProcessCallback& procCallback) //resolved dirname ending with path separator
{
- if (dirnameFmt.empty()) return;
+ if (dirnameFmt.empty() ||
+ !dirExistsUpdating(dirnameFmt, procCallback))
+ return;
+
if (lockHolder.find(dirnameFmt) != lockHolder.end()) return;
assert(dirnameFmt.EndsWith(FILE_NAME_SEPARATOR)); //this is really the contract, formatting does other things as well, e.g. macro substitution
@@ -37,7 +41,7 @@ public:
catch (const FileError& e)
{
bool dummy = false; //this warning shall not be shown but logged only
- procCallback.reportWarning(e.msg(), dummy);
+ procCallback.reportWarning(e.msg(), dummy); //may throw!
}
}
bgstack15