diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2019-11-13 16:04:31 +0300 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-13 16:37:04 +0100 |
commit | d3504b4f9b6e2688a31e8776ff22e1b2e6828e38 (patch) | |
tree | 1d9fbee5ac18ee7e1ca3f2efff7b45ec90a2060f /DevTools/HackStudio | |
parent | bf012ca10a9da916c5db9a6c9500622f055692df (diff) | |
download | serenity-d3504b4f9b6e2688a31e8776ff22e1b2e6828e38.zip |
Terminal+HackStudio: Fix leaking PTM fd to child processes
The pseudoterminal *master* fd is not supposed to be inherited,
so make sure to open it with O_CLOEXEC.
Diffstat (limited to 'DevTools/HackStudio')
-rw-r--r-- | DevTools/HackStudio/TerminalWrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/DevTools/HackStudio/TerminalWrapper.cpp b/DevTools/HackStudio/TerminalWrapper.cpp index 90ae3b3476..4319666994 100644 --- a/DevTools/HackStudio/TerminalWrapper.cpp +++ b/DevTools/HackStudio/TerminalWrapper.cpp @@ -24,7 +24,7 @@ void TerminalWrapper::run_command(const String& command) return; } - int ptm_fd = open("/dev/ptmx", O_RDWR); + int ptm_fd = open("/dev/ptmx", O_RDWR | O_CLOEXEC); if (ptm_fd < 0) { perror("open(ptmx)"); ASSERT_NOT_REACHED(); |