From 0f9f27b3a81076edcfcd7a8637143405f6ada267 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 24 May 2008 16:22:12 +0000 Subject: * fixed a problem with a failing child process passing the death gate by throwing - this resulted in the seemingly weirdest behaviour of the config-demuxer (which was actually the child process trying to demux from within the chroot) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1795 95ad53e4-c205-0410-b2fa-d234c58c8868 --- lib/OpenSLX/Basics.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/OpenSLX/Basics.pm') diff --git a/lib/OpenSLX/Basics.pm b/lib/OpenSLX/Basics.pm index 4b40269e..679b9acb 100644 --- a/lib/OpenSLX/Basics.pm +++ b/lib/OpenSLX/Basics.pm @@ -326,8 +326,10 @@ sub callInSubprocess my $pid = fork(); if (!$pid) { # child -> execute the given function and exit: - eval { $childFunc->(); 1 } - or die $@; + if (! eval { $childFunc->(); 1 }) { + $@ = "*** $@" unless substr( $@, 0, 4) eq '*** '; + print STDERR "$@\n"; + } exit 0; } @@ -803,14 +805,13 @@ sub _doThrowOrWarn my $type = shift; my $msg = shift; - # use '°°°' for warnings and '***' for errors + # use '! ' for warnings and '***' for errors + $msg =~ s[^(! |\*\*\*) ][]gms; if ($type eq 'carp' || $type eq 'warn' || $type eq 'cluck') { - $msg =~ s[^(! |\*\*\*) ][]igms; - $msg =~ s[^][! ]igms; + $msg =~ s[^][! ]gms; } else { - $msg =~ s[^(! |\*\*\*) ][]igms; - $msg =~ s[^][*** ]igms; + $msg =~ s[^][*** ]gms; } if ($openslxConfig{'debug-confess'}) { -- cgit v1.2.3-55-g7522