-my ($hn,$ha,$at,$naddrs,@addrs) = gethostbyname $spechost;
-fail "hostname/address mismatch ($spechost $server_addr)" unless grep {
- $server_addr eq inet_ntoa $_
- } @addrs;
+ kill -9, $child or fail "kill fetch/clone: $!";
+ $!=0; $?=0; if (!close FETCHERR) {
+ fail "reap fetch/clone: $!" if $!;
+ my $fetchfail =
+ !($? & 255) ? "$cmd[0] died with error exit code ".($? >> 8) :
+ $? != 9 ? "$cmd[0] died due to fatal signa, status $?" :
+ $timedout ? "$cmd[0] timed out (${fetchtimeout}s)" :
+ "$cmd[0] died due to unexpected SIGKILL";
+ if (length $fetcherr) {
+ $fetchfail .= "\n$fetcherr";
+ $fetchfail =~ s{\n}{ // }g;
+ }
+ if ($fetch >= 2) {
+ gitfail $fetchfail;
+ } else {
+ log 'info', "$specpatch fetch failed: $fetchfail";
+ }
+ }