mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +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) {
|
bool mg_socketpair(int *s1, int *s2) {
|
||||||
#if MG_ARCH == MG_ARCH_UNIX
|
#if MG_ARCH == MG_ARCH_UNIX
|
||||||
int sp[2], ret = 0;
|
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;
|
*s1 = sp[0], *s2 = sp[1], ret = 1;
|
||||||
}
|
}
|
||||||
return ret;
|
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) {
|
bool mg_socketpair(int *s1, int *s2) {
|
||||||
#if MG_ARCH == MG_ARCH_UNIX
|
#if MG_ARCH == MG_ARCH_UNIX
|
||||||
int sp[2], ret = 0;
|
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;
|
*s1 = sp[0], *s2 = sp[1], ret = 1;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in new issue
Block a user