On Fri, Dec 09, 2011 at 11:37:39AM +0100, Eelco Dolstra wrote:
> On 09/12/11 11:21, Ludovic Courtès wrote:
> > -if (system("exec ssh $hostName @sshOpts '(read; kill -INT -\$\$) <&0 &
> > nix-store -r $drvPath $buildFlags > /dev/null' 2>&4") != 0) {
> > +if (system("exec ssh $hostName @sshOpts 'trap \"kill -INT -\$\$\" SIGPIPE
> > ; nix-store -r $drvPath $buildFlags > /dev/null' 2>&4") != 0) {
>
> Does this actually work? A process only gets a SIGPIPE if it does a write(),
> right? So if "nix-store -r" doesn't do any writes, it won't get a SIGPIPE, so
> it will continue indefinitely even if the connection is down. But if it does
> write, it will get a write() error and exit. (Nix ignores SIGPIPE, by the
> way).
I imagine it does not matter, but I think only a *second write* in a
other-side-closed fd
ends up in sigpipe. The first returns -1.
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev