From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RxpGm-0006zp-Pv for garchives@archives.gentoo.org; Thu, 16 Feb 2012 00:32:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 602CCE0AB4; Thu, 16 Feb 2012 00:26:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2AE3AE0A89 for ; Thu, 16 Feb 2012 00:26:36 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ABE9F1B4036 for ; Thu, 16 Feb 2012 00:26:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3413CE5420 for ; Thu, 16 Feb 2012 00:26:35 +0000 (UTC) From: "Kent Fredric" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kent Fredric" Message-ID: <1316676401.96e36ba5d7a32ff510915d54b089386554466986.kent@gentoo> Subject: [gentoo-commits] proj/perl-overlay:eclass-moretests commit in: scripts/ X-VCS-Repository: proj/perl-overlay X-VCS-Files: scripts/ssh_multiplex.pl X-VCS-Directories: scripts/ X-VCS-Committer: kent X-VCS-Committer-Name: Kent Fredric X-VCS-Revision: 96e36ba5d7a32ff510915d54b089386554466986 X-VCS-Branch: eclass-moretests Date: Thu, 16 Feb 2012 00:26:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: b0342e8b-5b83-4bcd-808f-e4f3faa0f15f X-Archives-Hash: 18c87e52d9c3b065357fa0340e9a4f98 commit: 96e36ba5d7a32ff510915d54b089386554466986 Author: Kent Fredric gmail com> AuthorDate: Wed Sep 21 10:14:06 2011 +0000 Commit: Kent Fredric gmail com> CommitDate: Thu Sep 22 07:26:41 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/perl-overlay.= git;a=3Dcommit;h=3D96e36ba5 [scripts] make multiplex script +x [scripts] make error conditions in ssh_multiplex script clearer --- scripts/ssh_multiplex.pl | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/ssh_multiplex.pl b/scripts/ssh_multiplex.pl old mode 100644 new mode 100755 index a83cd62..cb3d4c9 --- a/scripts/ssh_multiplex.pl +++ b/scripts/ssh_multiplex.pl @@ -77,20 +77,26 @@ sub map_param { =20 sub spawn_child { my (@cmd) =3D @_; + local $!; + local $?; + local $@; my $cleanup =3D pop @cmd; my $pid; if ( not defined( $pid =3D fork() ) ) { - my (@error) =3D ( $!, $?, $@ ); + my (%error) =3D ( '$!', $!, '$?', $?, '$@', $@ ); require Carp; - Carp::croak("Forking Failed :( @error "); + Carp::croak( 'Forking Failed :( ' . dump \%error ); } if ($pid) { return $pid; } + local $!; + local $?; + local $@; system(@cmd) =3D=3D 0 or do { - my (@error) =3D ( $!, $?, $@ ); + my (%error) =3D ( '$!', $!, '$?', $?, '$@', $@ ); require Carp; - Carp::croak("Running command Failed :( @error "); + Carp::croak( 'Running command Failed :( ' . dump \%error ); }; $cleanup->(); exit;