On Sat, 2012-04-28 at 21:59 +0800, Liu Yuan wrote: > On 04/28/2012 09:54 PM, Christoph Hellwig wrote: > > > We'd still like to print the pid of the died sheep pid - getppid() > > should do that work for that. > > > Yes, I tried use getppid() initially, but I found that getppid() always > return 1 in my distro (ubuntu) and I didn't try to trace why. So I > simply remove pid, given that some bug in other place or my dirstro goes > ill-configured. > > Maybe I'd better call getppid() here and wait fixes from other place. The reason getppid() returns 1 is that it was called in the sheep, and the parent is (correctly) init. If log_sigexit() is called in the sheep, you need getpid(). Since it is possible for any signal, especially SEGV, to be delivered either to the sheep or the logger, we need a flag to tell the method which process received the signal. Christoph, remember we discussed this briefly? S. |