diff options
| -rw-r--r-- | libbb/xgethostbyname.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/xgethostbyname.c b/libbb/xgethostbyname.c index 0bbe18da2..c3158c339 100644 --- a/libbb/xgethostbyname.c +++ b/libbb/xgethostbyname.c | |||
| @@ -10,13 +10,10 @@ | |||
| 10 | #include <netdb.h> | 10 | #include <netdb.h> |
| 11 | #include "libbb.h" | 11 | #include "libbb.h" |
| 12 | 12 | ||
| 13 | |||
| 14 | struct hostent *xgethostbyname(const char *name) | 13 | struct hostent *xgethostbyname(const char *name) |
| 15 | { | 14 | { |
| 16 | struct hostent *retval; | 15 | struct hostent *retval = gethostbyname(name); |
| 17 | 16 | if (!retval) | |
| 18 | if ((retval = gethostbyname(name)) == NULL) | ||
| 19 | bb_herror_msg_and_die("%s", name); | 17 | bb_herror_msg_and_die("%s", name); |
| 20 | |||
| 21 | return retval; | 18 | return retval; |
| 22 | } | 19 | } |
