]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Windows has EACCES, not EACCESS
authorSebastian Hahn <sebastian@torproject.org>
Fri, 11 Feb 2011 15:57:53 +0000 (16:57 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Fri, 11 Feb 2011 16:02:26 +0000 (17:02 +0100)
Once again spotted by mobmix

Also add a changes file for the fix

changes/bug2504 [new file with mode: 0644]
src/common/compat.c

diff --git a/changes/bug2504 b/changes/bug2504
new file mode 100644 (file)
index 0000000..791600e
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix a bug with our locking implementation on windows that couldn't
+      correctly detect when a file was already locked. Fixes bug 2504,
+      bugfix on 0.2.1.6-alpha.
+
index 5dfde3dc03737cbe7de96996f2bd8e00e0ec943f..d29cacf372ea23af6d28b001ed758b4161279f37 100644 (file)
@@ -699,7 +699,7 @@ tor_lockfile_lock(const char *filename, int blocking, int *locked_out)
 #ifdef WIN32
   _lseek(fd, 0, SEEK_SET);
   if (_locking(fd, blocking ? _LK_LOCK : _LK_NBLCK, 1) < 0) {
-    if (errno != EACCESS && errno != EDEADLOCK)
+    if (errno != EACCES && errno != EDEADLOCK)
       log_warn(LD_FS,"Couldn't lock \"%s\": %s", filename, strerror(errno));
     else
       *locked_out = 1;