diff options
Diffstat (limited to 'libc/dns/net/nsdispatch.c')
-rw-r--r-- | libc/dns/net/nsdispatch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/dns/net/nsdispatch.c b/libc/dns/net/nsdispatch.c index fb6d8f6ab..d025592a0 100644 --- a/libc/dns/net/nsdispatch.c +++ b/libc/dns/net/nsdispatch.c @@ -71,6 +71,7 @@ #include <sys/cdefs.h> #include <assert.h> +#include <errno.h> #include <nsswitch.h> #include <stdarg.h> #include <strings.h> @@ -133,6 +134,10 @@ nsdispatch(void *retval, const ns_dtab disp_tab[], const char *database, continue; if (result & srclist[i].flags) break; + /* Stop trying next resolver when there is a memory space fatal error. */ + if ((result & NS_UNAVAIL) != 0 && errno == ENOSPC) { + break; + } } } result &= NS_STATUSMASK; /* clear private flags in result */ |