mirror of
https://github.com/moparisthebest/SickRage
synced 2024-10-31 15:35:01 -04:00
Use errno.ENOSYS instead of 38.
This commit is contained in:
parent
de6cd8d9f1
commit
b283015d38
@ -5,6 +5,7 @@ import os
|
|||||||
|
|
||||||
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
|
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
|
||||||
AlreadyLocked)
|
AlreadyLocked)
|
||||||
|
import errno
|
||||||
|
|
||||||
class LinkLockFile(LockBase):
|
class LinkLockFile(LockBase):
|
||||||
"""Lock access to a file using atomic property of link(2).
|
"""Lock access to a file using atomic property of link(2).
|
||||||
@ -29,7 +30,7 @@ class LinkLockFile(LockBase):
|
|||||||
try:
|
try:
|
||||||
os.link(self.unique_name, self.lock_file)
|
os.link(self.unique_name, self.lock_file)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == 38:
|
if e.errno == errno.ENOSYS:
|
||||||
raise LockFailed("%s" % e.strerror)
|
raise LockFailed("%s" % e.strerror)
|
||||||
# Link creation failed. Maybe we've double-locked?
|
# Link creation failed. Maybe we've double-locked?
|
||||||
nlinks = os.stat(self.unique_name).st_nlink
|
nlinks = os.stat(self.unique_name).st_nlink
|
||||||
|
Loading…
Reference in New Issue
Block a user