mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 14:24:17 +02:00
Fix O_NONBLOCK for self pipe on macOS
This commit is contained in:
parent
804868e514
commit
6144b06e47
1 changed files with 5 additions and 1 deletions
|
|
@ -829,7 +829,11 @@ def setup_unix_signals(self):
|
|||
cloexec_flag = getattr(fcntl, 'FD_CLOEXEC', 1)
|
||||
for fd in (read_fd, write_fd):
|
||||
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 = {}
|
||||
for sig in (signal.SIGINT, signal.SIGTERM):
|
||||
|
|
|
|||
Loading…
Reference in a new issue