1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-10 06:06:33 +00:00

Fixed build issues on disabled features

This commit is contained in:
Gerhard Rieger 2025-01-29 21:49:16 +01:00
parent af7d44d751
commit 7a90caade5
21 changed files with 182 additions and 95 deletions

View file

@ -95,3 +95,26 @@ static int xioopen_socketpair(
}
#endif /* WITH_SOCKETPAIR */
#if _WITH_SOCKETPAIR
/* retrieves options so-type and so-prototype from opts, calls socketpair, and
ev. generates an appropriate error message.
returns 0 on success or -1 if an error occurred. */
int
xiosocketpair(struct opt *opts, int pf, int socktype, int proto, int sv[2]) {
int result;
retropt_int(opts, OPT_SO_TYPE, &socktype);
retropt_int(opts, OPT_SO_PROTOTYPE, &proto);
result = Socketpair(pf, socktype, proto, sv);
if (result < 0) {
Error5("socketpair(%d, %d, %d, %p): %s",
pf, socktype, proto, sv, strerror(errno));
return -1;
}
return result;
}
#endif /* _WITH_SOCKETPAIR */