From bf1b5e18961a9968325287d6b243747428f9022a Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 6 Oct 2015 17:06:46 -0700 Subject: [PATCH] clones: set unix socket to autoflush just in case When initiating a clone, a "clone " message is sent to the taskd.pl's unix socket. Make sure the connection is in autoflush mode so it doesn't accidentally get dropped when the socket is closed. The socket will likely be created in autoflush mode already, but set the flag just in case it hasn't been (older Perls or other inexplicable reason). Signed-off-by: Kyle J. McKay --- Girocco/Project.pm | 1 + toolbox/remirror-project.pl | 1 + 2 files changed, 2 insertions(+) diff --git a/Girocco/Project.pm b/Girocco/Project.pm index 9f5d668..4082145 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -861,6 +861,7 @@ sub clone { use IO::Socket; my $sock = IO::Socket::UNIX->new($Girocco::Config::chroot.'/etc/taskd.socket') or die "cannot connect to taskd.socket: $!"; + select((select($sock),$|=1)[0]); $sock->print("clone ".$self->{name}."\n"); # Just ignore reply, we are going to succeed anyway and the I/O # would apparently get quite hairy. diff --git a/toolbox/remirror-project.pl b/toolbox/remirror-project.pl index 493d408..b8a4d50 100755 --- a/toolbox/remirror-project.pl +++ b/toolbox/remirror-project.pl @@ -31,6 +31,7 @@ open X, '>', $cp or die "failed to create $cp: $!"; close X; my $sock = IO::Socket::UNIX->new($Girocco::Config::chroot.'/etc/taskd.socket') or die "cannot connect to taskd.socket: $!"; +select((select($sock),$|=1)[0]); $sock->print("clone ".$p->{name}."\n"); # Just ignore reply, we are going to succeed anyway and the I/O # would apparently get quite hairy. -- 2.11.4.GIT