Skip to content

Commit f20f476

Browse files
committed
Use builtin facility for removing cloexec
1 parent c004fd1 commit f20f476

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kitty/child.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
33

4-
import fcntl
54
import os
65
import sys
76
from collections import defaultdict
@@ -144,7 +143,7 @@ def environ_of_process(pid: int) -> Dict[str, str]:
144143

145144

146145
def remove_cloexec(fd: int) -> None:
147-
fcntl.fcntl(fd, fcntl.F_SETFD, fcntl.fcntl(fd, fcntl.F_GETFD) & ~fcntl.FD_CLOEXEC)
146+
os.set_inheritable(fd, True)
148147

149148

150149
def remove_blocking(fd: int) -> None:

0 commit comments

Comments
 (0)