Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Mini xgethostbyname implementation. |
| 4 | * |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 5 | * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>. |
| 6 | * |
"Robert P. J. Day" | 5d8843e | 2006-07-10 11:41:19 +0000 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <netdb.h> |
Matt Kraai | 8f7a4ad | 2001-05-16 17:05:03 +0000 | [diff] [blame] | 11 | #include "libbb.h" |
| 12 | |
Eric Andersen | 74400cc | 2001-10-18 04:11:39 +0000 | [diff] [blame] | 13 | |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 14 | struct hostent *xgethostbyname(const char *name) |
| 15 | { |
| 16 | struct hostent *retval; |
| 17 | |
| 18 | if ((retval = gethostbyname(name)) == NULL) |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 19 | bb_herror_msg_and_die("%s", name); |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 20 | |
| 21 | return retval; |
| 22 | } |