From ff02409fdd40adc1611a11e0be3c1dcf9e36af3e Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 16 Apr 2013 21:13:21 +0900 Subject: fix flock errno under osx --- src/leap/platform_init/locks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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: -- cgit v1.2.3