diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2007-06-12 22:52:10 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-16 09:11:58 -0700 |
commit | 7cbf2f24ee8430fbf48a2c6f106f22adf9df62e1 (patch) | |
tree | c03badff95c43da77fb12f395fbb2c98f5d15633 /connect.c | |
parent | 3e48af387522bfff8ae410cfda28c3eefd1cebad (diff) | |
download | git-7cbf2f24ee8430fbf48a2c6f106f22adf9df62e1.tar.gz |
Do not use h_errno after connect(2): the function does not set it
Randal L. Schwartz noticed compilation problems on SunOS, which made
me look at the code again. The thing is, h_errno is not used by
connect(2), it is only for functions from netdb.h, like gethostbyname.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r-- | connect.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -224,11 +224,10 @@ static int git_tcp_connect_sock(char *host, int flags) } if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) { saved_errno = errno; - fprintf(stderr, "%s[%d: %s]: net=%s, errno=%s\n", + fprintf(stderr, "%s[%d: %s]: errno=%s\n", host, cnt, ai_name(ai), - hstrerror(h_errno), strerror(saved_errno)); close(sockfd); sockfd = -1; @@ -315,11 +314,10 @@ static int git_tcp_connect_sock(char *host, int flags) if (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) { saved_errno = errno; - fprintf(stderr, "%s[%d: %s]: net=%s, errno=%s\n", + fprintf(stderr, "%s[%d: %s]: errno=%s\n", host, cnt, inet_ntoa(*(struct in_addr *)&sa.sin_addr), - hstrerror(h_errno), strerror(saved_errno)); close(sockfd); sockfd = -1; |