ソースを参照

Patch from Mike McDonald to make gethostbyname_r() not fail for things like
gethostbyname("192.168.0.1"), which should work even when the /etc/hosts and
/etc/config/hosts files do not exist.

Eric Andersen 23 年 前
コミット
8c8fbab31d
1 ファイル変更5 行追加0 行削除
  1. 5 0
      libc/inet/resolv.c

+ 5 - 0
libc/inet/resolv.c

@@ -1578,6 +1578,11 @@ int gethostbyname_r(const char * name,
 		case HOST_NOT_FOUND:
 		case NO_ADDRESS:
 			break;
+		case NETDB_INTERNAL:
+			if (errno == ENOENT) {
+			    break;
+			}
+			/* else fall through */
 		default:
 			return i;
 	}