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
This commit is contained in:
@@ -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 <[email protected]>
|
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
|
||||||
* Copyright (c) 2004 Daniel Furrer <[email protected]>
|
* Copyright (c) 2004 Daniel Furrer <[email protected]>
|
||||||
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
* Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "Shell.h"
|
#include "Shell.h"
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
@@ -398,6 +399,9 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
|
|||||||
if (fProcessID == 0) {
|
if (fProcessID == 0) {
|
||||||
// Now in child process.
|
// Now in child process.
|
||||||
|
|
||||||
|
// close the PTY master side
|
||||||
|
close(master);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make our controlling tty the pseudo tty. This hapens because
|
* Make our controlling tty the pseudo tty. This hapens because
|
||||||
* we cleared our original controlling terminal above.
|
* we cleared our original controlling terminal above.
|
||||||
|
|||||||
Reference in New Issue
Block a user