connect: only log if all attempts failed (ipv4)
In
63a995b (Do not log unless all connect() attempts fail), a
mechanism to only log connection errors if all attempts failed
was introduced for the IPv6 code-path, but not for the IPv4 one.
Introduce a matching mechanism so IPv4-users also benefit from
this noise-reduction.
Move the call to socket after filling in sa, to make it more
apparent that errno can't change in between.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>