[haiku-commits] r35584 - haiku/trunk/src/apps/terminal

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 23 Feb 2010 14:49:30 +0100 (CET)

Author: bonefish
Date: 2010-02-23 14:49:30 +0100 (Tue, 23 Feb 2010)
New Revision: 35584
Changeset: http://dev.haiku-os.org/changeset/35584/haiku
Ticket: http://dev.haiku-os.org/ticket/3340
Ticket: http://dev.haiku-os.org/ticket/5395

Modified:
   haiku/trunk/src/apps/terminal/Shell.cpp
Log:
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.


Modified: haiku/trunk/src/apps/terminal/Shell.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/Shell.cpp     2010-02-23 13:45:28 UTC (rev 
35583)
+++ haiku/trunk/src/apps/terminal/Shell.cpp     2010-02-23 13:49:30 UTC (rev 
35584)
@@ -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 <myob@xxxxxxxxxxxxxxxxxxxxx>
  * Copyright (c) 2004 Daniel Furrer <assimil8or@xxxxxxxxxxxxxxxxxxxxx>
  * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
@@ -8,6 +8,7 @@
  *
  */
 
+
 #include "Shell.h"
 
 #include <dirent.h>
@@ -398,6 +399,9 @@
        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.


Other related posts:

  • » [haiku-commits] r35584 - haiku/trunk/src/apps/terminal - ingo_weinhold