[pve-devel] r5443 - pve-common/trunk/data/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jan 26 13:05:39 CET 2011


Author: dietmar
Date: 2011-01-26 13:05:39 +0100 (Wed, 26 Jan 2011)
New Revision: 5443

Modified:
   pve-common/trunk/data/PVE/RPCEnvironment.pm
Log:
simplify logic


Modified: pve-common/trunk/data/PVE/RPCEnvironment.pm
===================================================================
--- pve-common/trunk/data/PVE/RPCEnvironment.pm	2011-01-26 11:25:49 UTC (rev 5442)
+++ pve-common/trunk/data/PVE/RPCEnvironment.pm	2011-01-26 12:05:39 UTC (rev 5443)
@@ -294,11 +294,15 @@
 	POSIX::close ($psync[1]);
 
 	eval { &$function ($upid); };
-	my $err = $@ || "this code should not be reached";
-	my $msg = "worker function failed: $err";
-	syslog('err', $msg);
-	print STDERR "$msg\n";
-	POSIX::_exit (1); 
+	my $err = $@;
+	if ($err) {
+	    my $msg = "worker function failed: $err";
+	    syslog('err', $msg);
+	    print STDERR "$msg\n";
+	    POSIX::_exit(-1); 
+	} else {
+	    POSIX::_exit (0);
+	} 
 	kill ('KILL', $$); 
    }
 




More information about the pve-devel mailing list