summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-04-16 21:13:21 +0900
committerkali <kali@leap.se>2013-04-16 22:48:44 +0900
commitff02409fdd40adc1611a11e0be3c1dcf9e36af3e (patch)
tree57f2dc2ea05e8488bf7973a12a11af4ae09b8eae
parent1fbf6db1276c5bca41c4cfbcc90818d9605c1938 (diff)
fix flock errno under osx
-rw-r--r--src/leap/platform_init/locks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/platform_init/locks.py b/src/leap/platform_init/locks.py
index 2cdee3d9..f1672d8e 100644
--- a/src/leap/platform_init/locks.py
+++ b/src/leap/platform_init/locks.py
@@ -19,6 +19,7 @@ Utilities for handling multi-platform file locking mechanisms
"""
import commands
import logging
+import errno
import os
import platform
@@ -81,7 +82,10 @@ if platform_init.IS_UNIX:
flock(self._fd, LOCK_EX | LOCK_NB)
except IOError as exc:
# could not get the lock
- if exc.args[0] == 11:
+ #import ipdb; ipdb.set_trace()
+
+ if exc.args[0] in (errno.EDEADLK, errno.EAGAIN):
+ # errno 11 or 35
# Resource temporarily unavailable
return False
else: