mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 20:07:34 +00:00
SystemServer: Explicitly open /dev/null for services without StdIO
Spawning services with nothing open at all on the standard I/O fds is way too harsh. We now open /dev/null for them instead.
This commit is contained in:
parent
c2b7c43f3c
commit
9bd4bf41fb
2 changed files with 6 additions and 1 deletions
|
@ -190,6 +190,11 @@ void Service::spawn()
|
|||
close(STDIN_FILENO);
|
||||
close(STDOUT_FILENO);
|
||||
close(STDERR_FILENO);
|
||||
|
||||
int fd = open("/dev/null", O_RDWR);
|
||||
ASSERT(fd == STDIN_FILENO);
|
||||
dup2(STDIN_FILENO, STDOUT_FILENO);
|
||||
dup2(STDIN_FILENO, STDERR_FILENO);
|
||||
}
|
||||
|
||||
if (!m_socket_path.is_null()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue