mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix O_NONBLOCK for self pipe on macOS
This commit is contained in:
parent
804868e514
commit
6144b06e47
@ -829,7 +829,11 @@ def setup_unix_signals(self):
|
|||||||
cloexec_flag = getattr(fcntl, 'FD_CLOEXEC', 1)
|
cloexec_flag = getattr(fcntl, 'FD_CLOEXEC', 1)
|
||||||
for fd in (read_fd, write_fd):
|
for fd in (read_fd, write_fd):
|
||||||
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
|
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
|
||||||
fcntl.fcntl(fd, fcntl.F_SETFD, flags | cloexec_flag | os.O_NONBLOCK)
|
if flags != -1:
|
||||||
|
fcntl.fcntl(fd, fcntl.F_SETFD, flags | cloexec_flag)
|
||||||
|
flags = fcntl.fcntl(fd, fcntl.F_GETFL)
|
||||||
|
if flags != -1:
|
||||||
|
fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)
|
||||||
|
|
||||||
original_handlers = {}
|
original_handlers = {}
|
||||||
for sig in (signal.SIGINT, signal.SIGTERM):
|
for sig in (signal.SIGINT, signal.SIGTERM):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user