Put the new server into its own session.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19664 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -439,6 +439,9 @@ Services::_LaunchService(struct service& service, int socket)
|
|||||||
|
|
||||||
pid_t child = fork();
|
pid_t child = fork();
|
||||||
if (child == 0) {
|
if (child == 0) {
|
||||||
|
setsid();
|
||||||
|
// make sure we're in our own session, and don't accidently quit the net_server
|
||||||
|
|
||||||
// We're the child, replace standard input/output
|
// We're the child, replace standard input/output
|
||||||
dup2(socket, STDIN_FILENO);
|
dup2(socket, STDIN_FILENO);
|
||||||
dup2(socket, STDOUT_FILENO);
|
dup2(socket, STDOUT_FILENO);
|
||||||
|
|||||||
Reference in New Issue
Block a user