* chet@ins.CWRU.Edu
*/
-/* Copyright (C) 1987,1991 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2002 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
- Bash 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.
+ Bash 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 of the License, or
+ (at your option) any later version.
- Bash 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.
+ Bash 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 Bash; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+*/
#include <config.h>
#endif
#include <bashansi.h>
+#include <bashintl.h>
+
#include <errno.h>
#include <shell.h>
#endif
#ifndef HAVE_GETADDRINFO
+static int _getaddr __P((char *, struct in_addr *));
+static int _getserv __P((char *, int, unsigned short *));
+static int _netopen4 __P((char *, char *, int));
+#else /* HAVE_GETADDRINFO */
+static int _netopen6 __P((char *, char *, int));
+#endif
+
+static int _netopen __P((char *, char *, int));
+
+#ifndef HAVE_GETADDRINFO
/* Stuff the internet address corresponding to HOST into AP, in network
byte order. Return 1 on success, 0 on failure. */
int proto;
unsigned short *pp;
{
- long l;
+ intmax_t l;
unsigned short s;
if (legal_number (serv, &l))
if (_getaddr(host, &ina) == 0)
{
- internal_error ("%s: host unknown", host);
+ internal_error (_("%s: host unknown"), host);
errno = EINVAL;
return -1;
}
if (_getserv(serv, typ, &p) == 0)
{
- internal_error("%s: invalid service", serv);
+ internal_error(_("%s: invalid service"), serv);
errno = EINVAL;
return -1;
}
- bzero ((char *)&sin, sizeof(sin));
+ memset ((char *)&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = p;
sin.sin_addr = ina;
struct addrinfo hints, *res, *res0;
int gerr;
- bzero ((char *)&hints, sizeof (hints));
+ memset ((char *)&hints, 0, sizeof (hints));
/* XXX -- if problems with IPv6, set to PF_INET for IPv4 only */
#ifdef DEBUG /* PF_INET is the one that works for me */
hints.ai_family = PF_INET;
t = strchr (s, '/');
if (t == 0)
{
- internal_error ("%s: bad network path specification", path);
+ internal_error (_("%s: bad network path specification"), path);
return -1;
}
*t++ = '\0';
netopen (path)
char *path;
{
- internal_error ("network operations not supported");
+ internal_error (_("network operations not supported"));
return -1;
}