[Initng-svn] r4401 - in initng/trunk: plugins/simple_launcher src
svn at initng.thinktux.net
svn at initng.thinktux.net
Wed Jun 7 23:53:23 CEST 2006
Author: jimmy
Date: Wed Jun 7 23:53:22 2006
New Revision: 4401
Modified:
initng/trunk/plugins/bash_launcher/initng_bash_launcher.c
initng/trunk/plugins/simple_launcher/initng_simple_launcher.c
initng/trunk/src/initng_fork.c
Log:
Seems that all fds are not closed anyway on execve.
Modified: initng/trunk/plugins/bash_launcher/initng_bash_launcher.c
==============================================================================
--- initng/trunk/plugins/bash_launcher/initng_bash_launcher.c (original)
+++ initng/trunk/plugins/bash_launcher/initng_bash_launcher.c Wed Jun 7 23:53:22 2006
@@ -159,8 +159,12 @@
if ((pid_fork = initng_fork(s, process_to_exec)) == 0)
{
+ int i;
/* run afterfork hooks from other plugins */
initng_fork_aforkhooks(s, process_to_exec);
+
+ for (i=3;i<1024;i++)
+ close(i);
/* execute code */
bash_this(script, s, args);
Modified: initng/trunk/plugins/simple_launcher/initng_simple_launcher.c
==============================================================================
--- initng/trunk/plugins/simple_launcher/initng_simple_launcher.c (original)
+++ initng/trunk/plugins/simple_launcher/initng_simple_launcher.c Wed Jun 7 23:53:22 2006
@@ -175,6 +175,10 @@
/* run g.AFTER_FORK from other plugins */
initng_fork_aforkhooks(s, process_to_exec);
+ int i;
+ for(i=3;i<1024;i++)
+ close(i);
+
#ifdef DEBUG
D_("FROM_FORK simple_exec(%i,%s, ...);\n", argc, argv[0]);
/*D_argv("simple_exec: ", argv); */
Modified: initng/trunk/src/initng_fork.c
==============================================================================
--- initng/trunk/src/initng_fork.c (original)
+++ initng/trunk/src/initng_fork.c Wed Jun 7 23:53:22 2006
@@ -183,6 +183,7 @@
if (g.i_am == I_AM_INIT)
tcsetpgrp(0, getpgrp()); /* run this in foreground on fd 0 */
+
/* do a minimum sleep, to let the mother process
to register child, and notice death */
usleep(ALL_USLEEP);
More information about the Initng-svn
mailing list