summaryrefslogtreecommitdiff
path: root/Kernel/init.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-12 11:25:25 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-12 11:25:25 +0100
commit111589a5581d4bddce84ccb1ea7587b03dd55d98 (patch)
tree68db2d7c78a698dc865568880e193258f332149e /Kernel/init.cpp
parent7def86c86d09f8da12c8c64d81678ddb22677398 (diff)
downloadserenity-111589a5581d4bddce84ccb1ea7587b03dd55d98.zip
Kernel: Make sure processes always start out with fds 0, 1 and 2 open.
If we don't have a TTY for the process, fall back to /dev/null.
Diffstat (limited to 'Kernel/init.cpp')
-rw-r--r--Kernel/init.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 703d2ced29..ae7f5e8783 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -43,6 +43,7 @@ VirtualConsole* tty3;
Keyboard* keyboard;
PS2MouseDevice* ps2mouse;
GUIEventDevice* gui_event_device;
+NullDevice* dev_null;
VFS* vfs;
#ifdef STRESS_TEST_SPAWNING
@@ -72,7 +73,6 @@ static void init_stage2()
auto dev_zero = make<ZeroDevice>();
vfs->register_character_device(*dev_zero);
- auto dev_null = make<NullDevice>();
vfs->register_character_device(*dev_null);
auto dev_full = make<FullDevice>();
@@ -162,6 +162,7 @@ void init()
keyboard = new Keyboard;
ps2mouse = new PS2MouseDevice;
gui_event_device = new GUIEventDevice;
+ dev_null = new NullDevice;
VirtualConsole::initialize();
tty0 = new VirtualConsole(0, VirtualConsole::AdoptCurrentVGABuffer);