From 1e3815ba3bbf5cd9304f51e69a161300d2cb4fea Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 23 Feb 2010 13:49:30 +0000 Subject: [PATCH] After fork()ing we need to close the PTY master FD in the child. Otherwise closing/killing the Terminal will not automatically wake up children reading/writing the slave end. Fixes #3340 and probably #5395. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35584 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/Shell.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index 79dfb2f6e7..858d3a8e47 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007-2009, Haiku, Inc. All rights reserved. + * Copyright 2007-2010, Haiku, Inc. All rights reserved. * Copyright (c) 2003-4 Kian Duffy * Copyright (c) 2004 Daniel Furrer * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. @@ -8,6 +8,7 @@ * */ + #include "Shell.h" #include @@ -398,6 +399,9 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg if (fProcessID == 0) { // Now in child process. + // close the PTY master side + close(master); + /* * Make our controlling tty the pseudo tty. This hapens because * we cleared our original controlling terminal above.