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 1R6z5C-0004b7-Ml for garchives@archives.gentoo.org; Fri, 23 Sep 2011 06:17:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C6A5821C1AB; Fri, 23 Sep 2011 06:17:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9784121C1AB for ; Fri, 23 Sep 2011 06:17:11 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0562B1B4005 for ; Fri, 23 Sep 2011 06:17:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4312380042 for ; Fri, 23 Sep 2011 06:17:10 +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: <96e36ba5d7a32ff510915d54b089386554466986.kent@gentoo> Subject: [gentoo-commits] proj/perl-overlay:master 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 Date: Fri, 23 Sep 2011 06:17:10 +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: X-Archives-Hash: a7ae1829668acaca9ee76e75fa985ccf 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;