summaryrefslogtreecommitdiff
path: root/lib/dir_lock.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:20:50 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:20:50 +0200
commit7e706cf64654aea466c059c307e5723e2423ed5d (patch)
treee85f0d28d7c81b6d21419fc38e1a654cca2212b1 /lib/dir_lock.cpp
parent5.5 (diff)
downloadFreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.tar.gz
FreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.tar.bz2
FreeFileSync-7e706cf64654aea466c059c307e5723e2423ed5d.zip
5.6
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