diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-01-20 10:55:18 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-01-20 10:55:18 +0000 |
commit | 70e9163c9c18e995515598085cb824e554eb7ae7 (patch) | |
tree | a42dc8b2a6c031354bf31472de888bfc8a060132 /lib/canon-host.c | |
parent | cbf5993c43f49281173f185863577d86bfac6eae (diff) | |
download | coreutils-tarball-70e9163c9c18e995515598085cb824e554eb7ae7.tar.gz |
coreutils-8.25HEADcoreutils-8.25master
Diffstat (limited to 'lib/canon-host.c')
-rw-r--r-- | lib/canon-host.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/canon-host.c b/lib/canon-host.c index 50ba67a..101aec0 100644 --- a/lib/canon-host.c +++ b/lib/canon-host.c @@ -1,30 +1,28 @@ /* Host name canonicalization - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005-2016 Free Software Foundation, Inc. Written by Derek Price <derek@ximbiot.com>. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, or (at - your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include "canon-host.h" #include <string.h> - -#include "getaddrinfo.h" +#include <netdb.h> /* Store the last error for the single-threaded version of this function. */ static int last_cherror; @@ -71,11 +69,11 @@ canon_host_r (char const *host, int *cherror) if (!status) { /* http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00300.html - says Darwin 7.9.0 getaddrinfo returns 0 but sets - res->ai_canonname to NULL. */ + says Darwin 7.9.0 getaddrinfo returns 0 but sets + res->ai_canonname to NULL. */ retval = strdup (res->ai_canonname ? res->ai_canonname : host); if (!retval && cherror) - *cherror = EAI_MEMORY; + *cherror = EAI_MEMORY; freeaddrinfo (res); } else if (cherror) |