On Wed, 2011-11-09 at 15:31 +0100, Pavel Zuna wrote:
Updated patch attached.
Nack.
Please make "struct sss_sigchild_ctx" an opaque structure and provide an
init routine to create the hash and set up the signal handler. This way
we only have to call
sss_sigchild_init(ctx, &ctx->sigchld_ctx);
in be_process_init() (or any other executable that needs child control).
In sss_child_handler(), don't consider it fatal if the PID isn't found
in the hash. It could mean that something we're linked against did a
fork and was trying to maintain itself. This is bad, but not fatal.
Lower the debug level a bit (I think SSSDBG_OP_FAILURE is fine) and
allow the waitpid() loop to continue, rather than exiting immediately.
sss_child_ctx should be moved to child_common.c. Its internals should
not be visible elsewhere.
Please reorder sss_child_invoke_cb() to remove the entry from the hash
before invoking the callback (you cannot assume that the callback won't
do something funny to the hash structure or child_ctx, though it should
be safe). Also, please raise the debug level for this failure to
SSSDBG_OP_FAILURE.