diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-27 19:38:19 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-27 19:38:19 +0100 |
commit | 99069330a104e6d360635174be5f5ed054c418b8 (patch) | |
tree | f800b70a7b8989db14f5964b65534181d4a1a309 /networking | |
parent | ca228fb16dddc3c959adad97a930612a6b5256db (diff) | |
download | busybox-w32-99069330a104e6d360635174be5f5ed054c418b8.tar.gz busybox-w32-99069330a104e6d360635174be5f5ed054c418b8.tar.bz2 busybox-w32-99069330a104e6d360635174be5f5ed054c418b8.zip |
*: gethostname-related fixes
function old new delta
hostname_main 218 231 +13
nfsmount 3541 3474 -67
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/hostname.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/networking/hostname.c b/networking/hostname.c index 579eff795..121ad40bb 100644 --- a/networking/hostname.c +++ b/networking/hostname.c | |||
@@ -132,10 +132,14 @@ int hostname_main(int argc UNUSED_PARAM, char **argv) | |||
132 | if (*p) | 132 | if (*p) |
133 | puts(p + 1); | 133 | puts(p + 1); |
134 | } else /*if (opts & OPT_i)*/ { | 134 | } else /*if (opts & OPT_i)*/ { |
135 | while (hp->h_addr_list[0]) { | 135 | if (hp->h_length == sizeof(struct in_addr)) { |
136 | printf("%s ", inet_ntoa(*(struct in_addr *) (*hp->h_addr_list++))); | 136 | struct in_addr **h_addr_list = (struct in_addr **)hp->h_addr_list; |
137 | while (*h_addr_list) { | ||
138 | printf("%s ", inet_ntoa(**h_addr_list)); | ||
139 | h_addr_list++; | ||
140 | } | ||
141 | bb_putchar('\n'); | ||
137 | } | 142 | } |
138 | bb_putchar('\n'); | ||
139 | } | 143 | } |
140 | } else if (opts & OPT_F) { | 144 | } else if (opts & OPT_F) { |
141 | /* Set the hostname */ | 145 | /* Set the hostname */ |