From aa55caba36effee7a4e3bdaec561e9aa57ff7fd7 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 30 Sep 2010 16:58:20 +0200 Subject: [PATCH] weniger ausgaben --- c.rb | 16 +++++++--------- r.pl | 6 +++--- s.pl | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/c.rb b/c.rb index 45b51f3..e305240 100755 --- a/c.rb +++ b/c.rb @@ -35,18 +35,16 @@ end $tor = tor = IO.pipe $tos = tos = IO.pipe -if Process.fork +Process.fork do $stdin.reopen tor.first tor.last.close $stdout.reopen tos.last tos.first.close - $stderr.puts( {:ts => ts, :proc => 'c', :machine => machine, :source => source}.inspect) exec 'ssh', machine, 'perl', '-e', File.readall( File.join( libexec, 's.pl')).shdump, source.shdump -else - $stdin.reopen tos.first - tos.last.close - $stdout.reopen tor.last - tor.first.close - $stderr.puts( {:ts => ts, :proc => 'c', :exec => 'reciever', :destination => destination}.inspect) - exec 'perl', File.join( libexec, 'r.pl'), destination end + +$stdin.reopen tos.first +tos.last.close +$stdout.reopen tor.last +tor.first.close +exec 'perl', File.join( libexec, 'r.pl'), destination diff --git a/r.pl b/r.pl index 7c690ae..219ae88 100755 --- a/r.pl +++ b/r.pl @@ -11,7 +11,7 @@ sub ts { $SIG{CLD} = sub { wait; - printf STDERR "{ts: \"".ts."\", proc: \"r\", action: \"exit\", code: $?, error: \"child_died\"}\n"; + #printf STDERR "{ts: \"".ts."\", proc: \"r\", action: \"exit\", code: $?, error: \"child_died\"}\n"; exit $?; }; @@ -26,7 +26,7 @@ sub readcmd { chdir $ARGV[0] or die( "{ts: \"".ts."\", proc: \"r\", error: \"cannot_chdir\", exception: \"$!\"}\n"); while( my$data = readcmd) { (my$cmd, my$length) = unpack( 'nN', $data); - print STDERR "{ts: \"".ts."\", cmd: $cmd, length: $length}\n"; + #print STDERR "{ts: \"".ts."\", cmd: $cmd, length: $length}\n"; read STDIN, $data, $length; if( 1 == $cmd) { open( F, '>>', $data) or die( "{ts: \"".ts."\", proc: \"r\", error: \"unable_to_open_file\", message: \"Can't open file <$data>.\"}\n"); @@ -40,5 +40,5 @@ while( my$data = readcmd) { die( "{ts: \"".ts."\", proc: \"r\", error: \"unknown_command\", command: $cmd}\n"); } } -print STDERR "{ts: \"".ts."\", proc: \"r\", exit: 0}\n"; +#print STDERR "{ts: \"".ts."\", proc: \"r\", exit: 0}\n"; exit 0; diff --git a/s.pl b/s.pl index ef72794..110493b 100755 --- a/s.pl +++ b/s.pl @@ -31,5 +31,5 @@ while( my$filename = readdir( DH)) { close F; } closedir DH; -print STDERR "{ts: \"".ts."\", proc: \"s\", exit: 0}\n"; +#print STDERR "{ts: \"".ts."\", proc: \"s\", exit: 0}\n"; exit( 0);