fix rtl_tcp on macos

This commit is contained in:
rtlsdrblog 2023-08-28 22:35:49 +12:00
parent c79775f4b6
commit 41ca7ff956

View File

@ -571,7 +571,7 @@ int main(int argc, char **argv)
setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, (char *)&r, sizeof(int)); setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, (char *)&r, sizeof(int));
setsockopt(listensocket, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling)); setsockopt(listensocket, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling));
if (bind(listensocket, (struct sockaddr *)&local, sizeof(local))) if (bind(listensocket, (struct sockaddr *)&local, aiHead->ai_addrlen))
fprintf(stderr, "rtl_tcp bind error: %s", strerror(errno)); fprintf(stderr, "rtl_tcp bind error: %s", strerror(errno));
else else
break; break;