From f20f4762a8ae9a6fbd035417d316beb43948b336 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 Jun 2022 12:33:34 +0530 Subject: [PATCH] Use builtin facility for removing cloexec --- kitty/child.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kitty/child.py b/kitty/child.py index 689b77e4a..143e79c41 100644 --- a/kitty/child.py +++ b/kitty/child.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # License: GPL v3 Copyright: 2016, Kovid Goyal -import fcntl import os import sys from collections import defaultdict @@ -144,7 +143,7 @@ def environ_of_process(pid: int) -> Dict[str, str]: def remove_cloexec(fd: int) -> None: - fcntl.fcntl(fd, fcntl.F_SETFD, fcntl.fcntl(fd, fcntl.F_GETFD) & ~fcntl.FD_CLOEXEC) + os.set_inheritable(fd, True) def remove_blocking(fd: int) -> None: