* Simplify communication with the hook a bit (don't use file

descriptors 3/4, just use stdin/stderr).
This commit is contained in:
Eelco Dolstra 2009-03-28 19:29:55 +00:00
parent 7fb548aa26
commit 3a2bbe7f8a
6 changed files with 68 additions and 117 deletions

View file

@ -29,9 +29,7 @@ $maxSilentTime = 0 unless defined $maxSilentTime;
sub sendReply {
my $reply = shift;
open OUT, ">&3" or die;
print OUT "$reply\n";
close OUT;
print STDERR "# $reply\n";
}
sub decline {
@ -121,11 +119,8 @@ if (!defined $machine) {
# Yes we did, accept.
sendReply "accept";
open IN, "<&4" or die;
my $x = <IN>;
my $x = <STDIN>;
chomp $x;
#print "got $x\n";
close IN;
if ($x ne "okay") {
exit 0;