hoi :)

On Mon, Sep 04, 2006 at 08:21:19PM +0200, Jan-Benedict Glaw wrote:
> I think I'll save both of us from looking through the strace files
> since I think I just found the final reason (Disclaimer: I'm not a
> Perl hacker):
> 
> --------------------- /usr/sbin/faubackup --------------------------
> [...]
> open STDIN, "$gather |" or die "fork: $!";
> system( $scatter )==0 or exit $?;
> close STDIN or exit $?;
> 
> exit 0;
> ---------------End of: /usr/sbin/faubackup --------------------------
> 
> $scatter is the one that will fail. It'll call "exit(1)" at the very
> end. The return value of system() is then checked for 0 and I guess
> we're failing and exit'ing early. Notice that we exit with $?, which
> is probably not the exit() value of $scatter, but it's value <<8, as
> mentioned in `man perlfunc' in the "system" description. However, when
> the wrapping perl script finishes, only the low byte of it's exit()
> call is preserved, which is _not_ the $scatter exit value. So I guess
> the system() line should read something like:
> 
> system ($scatter) == 0 or exit $? >> 8;

you are right.

As $? looks like $? in the shell I thought it would behave the same way.
I'll add some code from the example in perlfunc(1) to preserve the
exit code.

Thank you very much for your help!

-- 
Martin Waitz

Attachment: signature.asc
Description: Digital signature

Reply via email to