Skip to content

Commit 3c9b24b

Browse files
committed
modsocket: Fix uClibc detection.
1 parent 141df2d commit 3c9b24b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

unix/modsocket.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
366366
sprintf(buf, "%d", port);
367367
serv = buf;
368368
hints.ai_flags = AI_NUMERICSERV;
369+
#ifdef __UCLIBC_MAJOR__
369370
#if __UCLIBC_MAJOR__ == 0 && (__UCLIBC_MINOR__ < 9 || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32))
370371
#warning Working around uClibc bug with numeric service name
371372
// Older versions og uClibc have bugs when numeric ports in service
@@ -376,6 +377,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(uint n_args, const mp_obj_t *args) {
376377
// Note that this is crude workaround, precluding UDP socket addresses
377378
// to be returned. TODO: set only if not set by Python args.
378379
hints.ai_socktype = SOCK_STREAM;
380+
#endif
379381
#endif
380382
} else {
381383
serv = mp_obj_str_get_str(args[1]);

0 commit comments

Comments
 (0)