[PATCH] Change inet_aton type from in_addr_t to int
GOTO Masanori
gotom@debian.or.jp
Wed Jul 21 15:36:00 GMT 2004
inet_aton type is defined as in_addr_t. But it returns the status,
not address. All other systems use int instead of in_addr_t. This
patch change inet_aton type from in_addr_t to int. Please review it.
Regards,
-- gotom
2004-07-22 GOTO Masanori <gotom@debian.or.jp>
[BZ #276]
* include/arpa/inet.h: Change inet_aton type from in_addr_t to int.
* inet/arpa/inet.h: Likewise.
* resolv/inet_addr.c: Likewise.
--- include/arpa/inet.h 3 Aug 2002 12:08:47 -0000 1.3
+++ include/arpa/inet.h 21 Jul 2004 15:28:01 -0000
@@ -1,6 +1,6 @@
#include <inet/arpa/inet.h>
-extern in_addr_t __inet_aton (__const char *__cp, struct in_addr *__inp);
+extern int __inet_aton (__const char *__cp, struct in_addr *__inp);
libc_hidden_proto (__inet_aton)
libc_hidden_proto (inet_aton)
--- resolv/inet_addr.c 3 Aug 2002 12:08:47 -0000 1.19
+++ resolv/inet_addr.c 21 Jul 2004 15:28:01 -0000
@@ -105,7 +105,7 @@
* This replaces inet_addr, the return value from which
* cannot distinguish between failure and a local broadcast address.
*/
-in_addr_t
+int
__inet_aton(const char *cp, struct in_addr *addr)
{
static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
--- inet/arpa/inet.h 6 Jul 2001 04:54:53 -0000 1.18
+++ inet/arpa/inet.h 21 Jul 2004 15:28:01 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -71,7 +71,7 @@
#ifdef __USE_MISC
/* Convert Internet host address from numbers-and-dots notation in CP
into binary data and store the result in the structure INP. */
-extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
/* Format a network number NET into presentation format and place result
in buffer starting at BUF with length of LEN bytes. */
More information about the Libc-alpha
mailing list