mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-17 10:49:47 +00:00
Fix native socketpair call
This commit is contained in:
1 parent
d1d8a77bf6
commit
228acefa36
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -2595,7 +2595,7 @@ static void accept_conn(struct mg_mgr *mgr, struct mg_connection *lsn) {
|
||||
bool mg_socketpair(int *s1, int *s2) {
|
||||
#if MG_ARCH == MG_ARCH_UNIX
|
||||
int sp[2], ret = 0;
|
||||
if (socketpair(AF_INET, SOCK_DGRAM, 0) == 0) {
|
||||
if (socketpair(AF_INET, SOCK_DGRAM, 0, sp) == 0) {
|
||||
*s1 = sp[0], *s2 = sp[1], ret = 1;
|
||||
}
|
||||
return ret;
|
||||
|
||||
+1
-1
@@ -358,7 +358,7 @@ static void accept_conn(struct mg_mgr *mgr, struct mg_connection *lsn) {
|
||||
bool mg_socketpair(int *s1, int *s2) {
|
||||
#if MG_ARCH == MG_ARCH_UNIX
|
||||
int sp[2], ret = 0;
|
||||
if (socketpair(AF_INET, SOCK_DGRAM, 0) == 0) {
|
||||
if (socketpair(AF_INET, SOCK_DGRAM, 0, sp) == 0) {
|
||||
*s1 = sp[0], *s2 = sp[1], ret = 1;
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in new issue
Block a user