mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-30 21:18:25 +00:00
PF_INET -> AF_INET, unbreaks FreeBSD
This commit is contained in:
1 parent
1d1a05bf39
commit
d5004cb7eb
1 file changed
+2
-2
+2
-2
@@ -831,7 +831,7 @@ struct ns_connection *ns_connect(struct ns_server *server, const char *host,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (host == NULL || (he = gethostbyname(host)) == NULL ||
|
if (host == NULL || (he = gethostbyname(host)) == NULL ||
|
||||||
(sock = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
|
(sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
|
||||||
DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
|
DBG(("gethostbyname(%s) failed: %s", host, strerror(errno)));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -3754,7 +3754,7 @@ static sock_t conn2(const char *host, int port) {
|
|||||||
|
|
||||||
if (host != NULL &&
|
if (host != NULL &&
|
||||||
(he = gethostbyname(host)) != NULL &&
|
(he = gethostbyname(host)) != NULL &&
|
||||||
(sock = socket(PF_INET, SOCK_STREAM, 0)) != INVALID_SOCKET) {
|
(sock = socket(AF_INET, SOCK_STREAM, 0)) != INVALID_SOCKET) {
|
||||||
set_close_on_exec(sock);
|
set_close_on_exec(sock);
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = htons((uint16_t) port);
|
sin.sin_port = htons((uint16_t) port);
|
||||||
|
|||||||
Reference in new issue
Block a user