/[cvs]/eggdrop1.8/src/compat/gethostbyname2.c
ViewVC logotype

Contents of /eggdrop1.8/src/compat/gethostbyname2.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Mon Aug 23 21:27:40 2010 UTC (8 years, 11 months ago) by pseudo
Branch: MAIN
CVS Tags: HEAD
Branch point for: gettext
Changes since 1.1: +11 -5 lines
File MIME type: text/x-chdr
Modified src/compat/ replacements of gethostbyname2() and inet_ntop() to not compile when IPv6 is disabled.
Added a missing header preventing gethostbyname2() from compiling on FreeBSD.
Fixed few lines with wrong indentation.

1 /*
2 * gethostbyname2.c -- provide a dummy gethostbyname2 replacement
3 *
4 * $Id: gethostbyname2.c,v 1.1 2010/08/05 18:12:05 pseudo Exp $
5 */
6 /*
7 * Copyright (C) 2010 Eggheads Development Team
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24 #include "gethostbyname2.h"
25
26 #if defined IPV6 && !defined HAVE_GETHOSTBYNAME2
27 struct hostent *gethostbyname2(const char *name, int af)
28 {
29 struct hostent *h;
30
31 h = gethostbyname(name);
32 if (!h)
33 return NULL;
34 if (h->h_addrtype != af) {
35 h_errno = NO_RECOVERY;
36 return NULL;
37 }
38
39 return h;
40 }
41 #endif

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23