mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-30 17:22:27 +00:00
Update Musl Libc code
We now have implement all of Musl's localization code, the same way that Musl implements localization. You may need setlocale(LC_ALL, "C.UTF-8"), just in case anything stops working as expected.
This commit is contained in:
parent
d0360bf4bd
commit
bb815eafaf
116 changed files with 6525 additions and 5523 deletions
24
third_party/python/Modules/socketmodule.c
vendored
24
third_party/python/Modules/socketmodule.c
vendored
|
@ -52,6 +52,8 @@
|
|||
#include "third_party/python/Include/warnings.h"
|
||||
#include "third_party/python/Include/yoink.h"
|
||||
#include "third_party/musl/netdb.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
#include "third_party/python/pyconfig.h"
|
||||
|
||||
PYTHON_PROVIDE("_socket");
|
||||
|
@ -1043,16 +1045,15 @@ setipaddr(const char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int
|
|||
set_gaierror(error);
|
||||
return -1;
|
||||
}
|
||||
switch (res->ai_family) {
|
||||
case AF_INET:
|
||||
if (res->ai_family == AF_INET) {
|
||||
siz = 4;
|
||||
break;
|
||||
}
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
else if (res->ai_family == AF_INET6) {
|
||||
siz = 16;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
else {
|
||||
freeaddrinfo(res);
|
||||
PyErr_SetString(PyExc_OSError,
|
||||
"unsupported address family");
|
||||
|
@ -1159,17 +1160,14 @@ setipaddr(const char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int
|
|||
addr_ret_size = res->ai_addrlen;
|
||||
memcpy((char *) addr_ret, res->ai_addr, addr_ret_size);
|
||||
freeaddrinfo(res);
|
||||
switch (addr_ret->sa_family) {
|
||||
case AF_INET:
|
||||
if (addr_ret->sa_family == AF_INET)
|
||||
return 4;
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
if (addr_ret->sa_family == AF_INET6)
|
||||
return 16;
|
||||
#endif
|
||||
default:
|
||||
PyErr_SetString(PyExc_OSError, "unknown address family");
|
||||
return -1;
|
||||
}
|
||||
PyErr_SetString(PyExc_OSError, "unknown address family");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
|
1
third_party/python/Modules/socketmodule.h
vendored
1
third_party/python/Modules/socketmodule.h
vendored
|
@ -3,6 +3,7 @@
|
|||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#include "third_party/python/Include/object.h"
|
||||
#include "libc/sock/struct/sockaddr6.h"
|
||||
#include "third_party/python/Include/pytime.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue