Deleted Added
full compact
getaddrinfo.c (238599) getaddrinfo.c (254700)
1/* $KAME: getaddrinfo.c,v 1.15 2000/07/09 04:37:24 itojun Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 40 unchanged lines hidden (view full) ---

49 * against NULL hostname (3) what is AI_ADDRCONFIG itself. AF not ready?
50 * non-loopback address configured? global address configured?
51 *
52 * OS specific notes for freebsd4:
53 * - FreeBSD supported $GAI. The code does not.
54 */
55
56#include <sys/cdefs.h>
1/* $KAME: getaddrinfo.c,v 1.15 2000/07/09 04:37:24 itojun Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 40 unchanged lines hidden (view full) ---

49 * against NULL hostname (3) what is AI_ADDRCONFIG itself. AF not ready?
50 * non-loopback address configured? global address configured?
51 *
52 * OS specific notes for freebsd4:
53 * - FreeBSD supported $GAI. The code does not.
54 */
55
56#include <sys/cdefs.h>
57__FBSDID("$FreeBSD: head/lib/libc/net/getaddrinfo.c 238599 2012-07-18 15:52:09Z emax $");
57__FBSDID("$FreeBSD: head/lib/libc/net/getaddrinfo.c 254700 2013-08-23 13:59:47Z jilles $");
58
59#include "namespace.h"
60#include <sys/types.h>
61#include <sys/param.h>
62#include <sys/socket.h>
63#include <net/if.h>
64#include <netinet/in.h>
65#include <sys/queue.h>

--- 2169 unchanged lines hidden (view full) ---

2235 *((struct addrinfo **)rv) = sentinel.ai_next;
2236 return NS_SUCCESS;
2237}
2238
2239static void
2240_sethtent(FILE **hostf)
2241{
2242 if (!*hostf)
58
59#include "namespace.h"
60#include <sys/types.h>
61#include <sys/param.h>
62#include <sys/socket.h>
63#include <net/if.h>
64#include <netinet/in.h>
65#include <sys/queue.h>

--- 2169 unchanged lines hidden (view full) ---

2235 *((struct addrinfo **)rv) = sentinel.ai_next;
2236 return NS_SUCCESS;
2237}
2238
2239static void
2240_sethtent(FILE **hostf)
2241{
2242 if (!*hostf)
2243 *hostf = fopen(_PATH_HOSTS, "r");
2243 *hostf = fopen(_PATH_HOSTS, "re");
2244 else
2245 rewind(*hostf);
2246}
2247
2248static void
2249_endhtent(FILE **hostf)
2250{
2251 if (*hostf) {

--- 7 unchanged lines hidden (view full) ---

2259{
2260 char *p;
2261 char *cp, *tname, *cname;
2262 struct addrinfo hints, *res0, *res;
2263 int error;
2264 const char *addr;
2265 char hostbuf[8*1024];
2266
2244 else
2245 rewind(*hostf);
2246}
2247
2248static void
2249_endhtent(FILE **hostf)
2250{
2251 if (*hostf) {

--- 7 unchanged lines hidden (view full) ---

2259{
2260 char *p;
2261 char *cp, *tname, *cname;
2262 struct addrinfo hints, *res0, *res;
2263 int error;
2264 const char *addr;
2265 char hostbuf[8*1024];
2266
2267 if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "r")))
2267 if (!*hostf && !(*hostf = fopen(_PATH_HOSTS, "re")))
2268 return (NULL);
2269again:
2270 if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf)))
2271 return (NULL);
2272 if (*p == '#')
2273 goto again;
2274 cp = strpbrk(p, "#\n");
2275 if (cp != NULL)

--- 573 unchanged lines hidden ---
2268 return (NULL);
2269again:
2270 if (!(p = fgets(hostbuf, sizeof hostbuf, *hostf)))
2271 return (NULL);
2272 if (*p == '#')
2273 goto again;
2274 cp = strpbrk(p, "#\n");
2275 if (cp != NULL)

--- 573 unchanged lines hidden ---