[pve-devel] r6371 - in pve-common/trunk/data: . PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 28 06:29:19 CEST 2011


Author: dietmar
Date: 2011-07-28 06:29:17 +0200 (Thu, 28 Jul 2011)
New Revision: 6371

Modified:
   pve-common/trunk/data/ChangeLog
   pve-common/trunk/data/PVE/Tools.pm
Log:
	* PVE/Tools.pm (run_command): fix $laststderr (do not suppress
	last line in some rare cases).



Modified: pve-common/trunk/data/ChangeLog
===================================================================
--- pve-common/trunk/data/ChangeLog	2011-07-27 10:46:44 UTC (rev 6370)
+++ pve-common/trunk/data/ChangeLog	2011-07-28 04:29:17 UTC (rev 6371)
@@ -1,3 +1,8 @@
+2011-07-28  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/Tools.pm (run_command): fix $laststderr (do not suppress
+	last line in some rare cases).
+
 2011-07-14  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/Tools.pm (encode_text, decode_text): useful functions to

Modified: pve-common/trunk/data/PVE/Tools.pm
===================================================================
--- pve-common/trunk/data/PVE/Tools.pm	2011-07-27 10:46:44 UTC (rev 6370)
+++ pve-common/trunk/data/PVE/Tools.pm	2011-07-28 04:29:17 UTC (rev 6371)
@@ -311,11 +311,14 @@
 	} elsif (my $sig = ($? & 127)) {
 	    die "got signal $sig\n";
 	} elsif (my $ec = ($? >> 8)) {
-	    die "$laststderr\n" if ($errmsg && $laststderr);
+	    if ($errmsg && $laststderr) {
+		my $lerr = $laststderr;
+		$laststderr = undef;
+		die "$lerr\n";
+	    }
 	    die "exit code $ec\n";
 	}
 
-	print STDERR "$laststderr\n" if $laststderr;
         alarm(0);
     };
 
@@ -323,6 +326,8 @@
 
     alarm(0);
 
+    print STDERR "$laststderr\n" if $laststderr;
+
     umask ($old_umask) if defined($old_umask);
 
     alarm($oldtimeout) if $oldtimeout;




More information about the pve-devel mailing list