Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
327fb51c
Commit
327fb51c
authored
Jun 09, 2012
by
Chris Young
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gethostbyname compatibility
parent
b9bfc768
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
include/git2/common.h
+1
-5
src/netops.c
+10
-2
No files found.
include/git2/common.h
View file @
327fb51c
...
@@ -56,11 +56,7 @@
...
@@ -56,11 +56,7 @@
#endif
#endif
#ifdef __amigaos4__
#ifdef __amigaos4__
/* Network byte order is big-endian... so is PPC, so these functions are NOP */
#include <netinet/in.h>
#define htonl(x) x
#define ntohl(x) x
#define htons(x) x
#define ntohs(x) x
#endif
#endif
/**
/**
...
...
src/netops.c
View file @
327fb51c
...
@@ -382,7 +382,9 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
...
@@ -382,7 +382,9 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
#else
#else
int
p
;
int
p
;
struct
hostent
*
hent
;
struct
hostent
*
hent
;
struct
servent
*
sent
;
struct
sockaddr_in
saddr
;
struct
sockaddr_in
saddr
;
long
port_num
=
0
;
#endif
#endif
int
ret
;
int
ret
;
GIT_SOCKET
s
=
INVALID_SOCKET
;
GIT_SOCKET
s
=
INVALID_SOCKET
;
...
@@ -397,6 +399,12 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
...
@@ -397,6 +399,12 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
}
}
#else
#else
hent
=
gethostbyname
(
host
);
hent
=
gethostbyname
(
host
);
sent
=
getservbyname
(
port
,
0
);
if
(
sent
)
port_num
=
sent
->
s_port
;
else
port_num
=
atol
(
port
);
#endif
#endif
#ifndef __amigaos4__
#ifndef __amigaos4__
...
@@ -413,9 +421,9 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
...
@@ -413,9 +421,9 @@ int gitno_connect(git_transport *t, const char *host, const char *port)
#ifndef __amigaos4__
#ifndef __amigaos4__
if
(
connect
(
s
,
p
->
ai_addr
,
(
socklen_t
)
p
->
ai_addrlen
)
==
0
)
if
(
connect
(
s
,
p
->
ai_addr
,
(
socklen_t
)
p
->
ai_addrlen
)
==
0
)
#else
#else
saddr
.
sin_addr
.
s_addr
=
*
hent
->
h_addr_list
[
p
]
;
memcpy
(
&
saddr
.
sin_addr
,
hent
->
h_addr_list
[
p
],
hent
->
h_length
)
;
saddr
.
sin_family
=
hent
->
h_addrtype
;
saddr
.
sin_family
=
hent
->
h_addrtype
;
saddr
.
sin_port
=
port
;
saddr
.
sin_port
=
port
_num
;
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
saddr
,
sizeof
(
struct
sockaddr_in
))
==
0
)
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
saddr
,
sizeof
(
struct
sockaddr_in
))
==
0
)
#endif
#endif
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment