summaryrefslogtreecommitdiff
path: root/library/lock_holder.h
diff options
context:
space:
mode:
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