busybox/networking
Michael Tokarev e9355c4326 hostname: do not use gethostbyname() for "hostname -s"
There's no reason to call gethostbyname() on the value returned
by uname() when asked just for a short name of a host.  This may
also be wrong, when uname is set to one value, but in /etc/hosts
(or elsewhere) the "canonical" name is different.  This is often
the case for localhost entry in /etc/hosts:

  127.0.0.1     localhost       myname

With this content of /etc/hosts, and uname being set to myname,
busybox hostname -s will return localhost, while regular
hostname utility returns myname.

Fix this by not calling gethostbyname() for the simple
'hostname -s' use.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-17 19:13:45 +01:00
..
2013-01-14 15:57:44 +01:00
2012-03-19 12:22:57 +01:00
2013-01-14 01:34:48 +01:00
2013-08-04 18:10:26 +02:00
2011-12-06 18:59:55 +01:00
2013-07-29 14:18:32 +02:00
2013-05-12 02:13:24 +02:00
2013-12-17 19:09:43 +01:00