Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

sunos: add getaddrinfo() compatibility hack

getaddrinfo() returns EAI_MEMORY if strlen(hostname) >= MAXHOSTNAMELEN
  • Loading branch information...
commit 26806e2b1c63e8090c261fb3f48f0d36e4bb4445 1 parent 04dfd46
Ben Noordhuis bnoordhuis authored

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. +8 0 src/unix/core.c
8 src/unix/core.c
@@ -589,6 +589,10 @@ int64_t uv_timer_get_repeat(uv_timer_t* timer) {
589 589 static int uv_getaddrinfo_done(eio_req* req) {
590 590 uv_getaddrinfo_t* handle = req->data;
591 591 struct addrinfo *res = handle->res;
  592 +#if __sun
  593 + size_t hostlen = strlen(handle->hostname);
  594 +#endif
  595 +
592 596 handle->res = NULL;
593 597
594 598 uv_unref(handle->loop);
@@ -605,6 +609,10 @@ static int uv_getaddrinfo_done(eio_req* req) {
605 609 } else if (handle->retcode == EAI_NONAME) {
606 610 #endif
607 611 uv__set_sys_error(handle->loop, ENOENT); /* FIXME compatibility hack */
  612 +#if __sun
  613 + } else if (handle->retcode == EAI_MEMORY && hostlen >= MAXHOSTNAMELEN) {
  614 + uv__set_sys_error(handle->loop, ENOENT);
  615 +#endif
608 616 } else {
609 617 handle->loop->last_err.code = UV_EADDRINFO;
610 618 handle->loop->last_err.sys_errno_ = handle->retcode;

0 comments on commit 26806e2

Please sign in to comment.
Something went wrong with that request. Please try again.