mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Mark the fd used for singleinstance of OS X as CLOEXEC
This commit is contained in:
parent
da0c6f8048
commit
acfff78330
@ -242,6 +242,8 @@ else:
|
||||
from calibre.utils.ipc import eintr_retry_call
|
||||
path = singleinstance_path(name)
|
||||
f = open(path, 'w')
|
||||
old_flags = fcntl.fcntl(f.fileno(), fcntl.F_GETFD)
|
||||
fcntl.fcntl(f.fileno(), fcntl.F_SETFD, old_flags | fcntl.FD_CLOEXEC)
|
||||
try:
|
||||
eintr_retry_call(fcntl.lockf, f.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB)
|
||||
atexit.register(_clean_lock_file, f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user