diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-06-27 23:22:51 +0200 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-08-24 09:12:18 +0100 |
commit | f329410d736916385a74dd22cbf5268db9b3c463 (patch) | |
tree | d92083403f6e97728d7ec2501827d48f3793a365 | |
parent | 98bc4759107c54783c08bf1ecde35e96f1345dc1 (diff) | |
download | busybox-w32-f329410d736916385a74dd22cbf5268db9b3c463.tar.gz busybox-w32-f329410d736916385a74dd22cbf5268db9b3c463.tar.bz2 busybox-w32-f329410d736916385a74dd22cbf5268db9b3c463.zip |
xconnect: avoid using getsockname/getpeername on Windows
The semantics of said functions is a bit different on Windows than on
Linux: it takes a `SOCKET` parameter instead of an `int` parameter, as
Windows does not use file descriptors for sockets.
The callers of these functions are only used in the daemons anyway,
though, and those are not compiled in busybox-w32.
Therefore, let's simply skip compiling those functions on Windows (as
well as `get_lsa()`, which would now be unused otherwise).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
-rw-r--r-- | libbb/xconnect.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c index ee54898e3..523bb62b1 100644 --- a/libbb/xconnect.c +++ b/libbb/xconnect.c | |||
@@ -69,6 +69,7 @@ int FAST_FUNC setsockopt_bindtodevice(int fd UNUSED_PARAM, | |||
69 | } | 69 | } |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #if !ENABLE_PLATFORM_MINGW32 | ||
72 | static len_and_sockaddr* get_lsa(int fd, int (*get_name)(int fd, struct sockaddr *addr, socklen_t *addrlen)) | 73 | static len_and_sockaddr* get_lsa(int fd, int (*get_name)(int fd, struct sockaddr *addr, socklen_t *addrlen)) |
73 | { | 74 | { |
74 | len_and_sockaddr lsa; | 75 | len_and_sockaddr lsa; |
@@ -97,6 +98,7 @@ len_and_sockaddr* FAST_FUNC get_peer_lsa(int fd) | |||
97 | { | 98 | { |
98 | return get_lsa(fd, getpeername); | 99 | return get_lsa(fd, getpeername); |
99 | } | 100 | } |
101 | #endif | ||
100 | 102 | ||
101 | void FAST_FUNC xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) | 103 | void FAST_FUNC xconnect(int s, const struct sockaddr *saddr, socklen_t addrlen) |
102 | { | 104 | { |