diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index ebfe8f270d..9fdd2de818 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -615,11 +615,12 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters) } } - if (done <= 0) + if (done <= 0) { + close(master); return B_ERROR; + } fFd = master; return B_OK; } -