From: Christian J. <ch...@gm...> - 2010-04-05 09:08:59
|
--- main.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/main.c b/main.c index 3dced09..0645421 100644 --- a/main.c +++ b/main.c @@ -297,6 +297,15 @@ int process_parent( int sv[2] ) /* Close the child socket */ close(sv[0]); + /* Don't hold on to resources that we will not use */ + chdir("/"); + close(0); + close(1); + /* do not close(2) as we still use stderr */ + + /* Don't be killed by signals sent to the previous process group */ + setsid(); + /* wait for request from the child */ do { struct msghdr msghdr={.msg_name=NULL}; -- 1.7.0.3 |