libc/inet: Unbreak gethostent()
commit6932f2282ba0578d6ca2f21eead920d6b78bc93c
authorWaldemar Brodkorb <wbx@uclibc-ng.org>
Sat, 2 Jan 2016 15:55:40 +0000 (2 16:55 +0100)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>
Sat, 2 Jan 2016 15:57:05 +0000 (2 16:57 +0100)
tree32a47ee8c76a645846dcd0c135b85eda6612fea2
parent4e9bdc2a5268fab79ea9190bdf5dbedb3cf36689
libc/inet: Unbreak gethostent()

Although gethostent() is obsoleted, there is no reason to keep it broken.
Fix two problems:

* commit f65e66078b "resolver: switch to config parser" leave an extra break
  statement in case of GETHOSTENT in __read_etc_hosts_r. In result,
  output buffer wasn't initialized at all.

* gethostent static buffer has insufficient size to store aliases,
  so __read_etc_hosts_r always returns ERANGE. Restore ALIAS_DIM define.

Add test-case.

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
libc/inet/resolv.c
test/inet/gethost.c [new file with mode: 0644]