[Nix-dev] vserver and waitid returning pid - 1 instead of pid? Cause?

Marc Weber marco-oweber at gmx.de
Sat Mar 14 17:44:22 CET 2009


Finally I've found the cause of my upstart problems.

This patch fixes the problem that upstart did'nt notice which child
process has finished.

diff --git a/nih/child.c b/nih/child.c
index 0f335b5..7cd93fb 100644
--- a/nih/child.c
+++ b/nih/child.c
@@ -162,6 +162,7 @@ nih_child_poll (void)
                pid = info.si_pid;
                if (! pid)
                        break;
+               pid ++; // why the hell doesn't this return the right pid?
 
                /* Convert siginfo information to handler function * arguments;
                 * in practice this is mostly just copying, with a few
                 * bits

the pid returned is the correct pid -1.

Any idea what might be causing this?
Can this be caused by using the wrong kernel headers?

Marc Weber



More information about the nix-dev mailing list