summaryrefslogtreecommitdiff
path: root/lib/dir_lock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dir_lock.cpp')
-rw-r--r--lib/dir_lock.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/dir_lock.cpp b/lib/dir_lock.cpp
index 682612a7..e385c9a8 100644
--- a/lib/dir_lock.cpp
+++ b/lib/dir_lock.cpp
@@ -17,7 +17,7 @@
#include <zen/assert_static.h>
#include <zen/int64.h>
#include <zen/file_handling.h>
-#include <wx+/serialize.h>
+#include <zen/serialize.h>
#ifdef FFS_WIN
#include <tlhelp32.h>
@@ -27,7 +27,8 @@
#include <Lmcons.h> //UNLEN
#elif defined FFS_LINUX
-#include <sys/stat.h>
+#include <fcntl.h> //::open()
+#include <sys/stat.h> //
#include <unistd.h>
#endif
@@ -484,7 +485,7 @@ void releaseLock(const Zstring& lockfilename) //throw ()
{
try
{
- removeFile(lockfilename);
+ removeFile(lockfilename); //throw FileError
}
catch (...) {}
}
@@ -511,6 +512,8 @@ bool tryLock(const Zstring& lockfilename) //throw FileError
}
::CloseHandle(fileHandle);
+ ::SetFileAttributes(applyLongPathPrefix(lockfilename).c_str(), FILE_ATTRIBUTE_HIDDEN); //(try to) hide it
+
#elif defined FFS_LINUX
//O_EXCL contains a race condition on NFS file systems: http://linux.die.net/man/2/open
::umask(0); //important! -> why?
bgstack15