From 16fceba54c9ceb80aa27e1368bcd26649c922b8f Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Mon, 20 May 2019 18:01:29 +0200 Subject: [PATCH] moved common used variables to top of function --- syncoid | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/syncoid b/syncoid index 389f1a9..83e44ee 100755 --- a/syncoid +++ b/syncoid @@ -271,6 +271,8 @@ sub syncdataset { my ($sourcehost, $sourcefs, $targethost, $targetfs, $origin, $skipsnapshot) = @_; + my $stdout, $stderr, $exit; + my $sourcefsescaped = escapeshellparam($sourcefs); my $targetfsescaped = escapeshellparam($targetfs); @@ -673,9 +675,6 @@ sub syncdataset { if (!$quiet) { print "Sending incremental $sourcefs#$bookmarkescaped ... $nextsnapshot (~ $disp_pvsize):\n"; } if ($debug) { print "DEBUG: $synccmd\n"; } - my $stdout; - my $stderr; - my $exit; ($stdout, $stderr, $exit) = tee { system("$synccmd") }; @@ -706,9 +705,6 @@ sub syncdataset { if (!$quiet) { print "Sending incremental $sourcefs#$bookmarkescaped ... $newsyncsnap (~ $disp_pvsize):\n"; } if ($debug) { print "DEBUG: $synccmd\n"; } - my $stdout; - my $stderr; - my $exit; ($stdout, $stderr, $exit) = tee { system("$synccmd") }; @@ -750,9 +746,6 @@ sub syncdataset { if (!$quiet) { print "Sending incremental $sourcefs\@$matchingsnap ... $newsyncsnap (~ $disp_pvsize):\n"; } if ($debug) { print "DEBUG: $synccmd\n"; } - my $stdout; - my $stderr; - my $exit; ($stdout, $stderr, $exit) = tee { system("$synccmd") };