summaryrefslogtreecommitdiff
path: root/sunrpc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-09-29 08:48:32 +0000
committerJakub Jelinek <jakub@redhat.com>2004-09-29 08:48:32 +0000
commit2b13f2ccc0b53bb2f3a4f6dcc006d4dea7149e16 (patch)
tree4d407d9cf3aaa05d597017bf8c326fda4e960f66 /sunrpc
parentf1750fb9c68854778e6e023ed490ff80e1c90167 (diff)
Updated to fedora-glibc-20040929T0821
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/Makefile4
-rw-r--r--sunrpc/Versions3
-rw-r--r--sunrpc/get_myaddr.c2
-rw-r--r--sunrpc/pmap_clnt.c2
-rw-r--r--sunrpc/pmap_rmt.c2
-rw-r--r--sunrpc/rpc/xdr.h2
-rw-r--r--sunrpc/rpc_parse.c12
-rw-r--r--sunrpc/tst-getmyaddr.c24
-rw-r--r--sunrpc/xdr_intXX_t.c11
9 files changed, 51 insertions, 11 deletions
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index 6431324f3e..284e355cc3 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1994-2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1994-2001, 2002, 2003, 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
@@ -85,6 +85,8 @@ all: # Make this the default target; it will be defined in Rules.
include ../Makeconfig
+xtests := tst-getmyaddr
+
ifeq ($(have-thread-library),yes)
xtests += thrsvc
endif
diff --git a/sunrpc/Versions b/sunrpc/Versions
index b800172e08..cddf188766 100644
--- a/sunrpc/Versions
+++ b/sunrpc/Versions
@@ -113,4 +113,7 @@ libc {
__rpc_thread_svc_fdset; __rpc_thread_createerr;
__rpc_thread_svc_pollfd; __rpc_thread_svc_max_pollfd;
}
+ GLIBC_2.3.4 {
+ xdr_quad_t; xdr_u_quad_t;
+ }
}
diff --git a/sunrpc/get_myaddr.c b/sunrpc/get_myaddr.c
index ee822970f9..c0beee9c59 100644
--- a/sunrpc/get_myaddr.c
+++ b/sunrpc/get_myaddr.c
@@ -63,7 +63,7 @@ get_myaddress (struct sockaddr_in *addr)
{
struct ifaddrs *ifa;
- if (getifaddrs (&ifa) == 0)
+ if (getifaddrs (&ifa) != 0)
{
perror ("get_myaddress: getifaddrs");
exit (1);
diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c
index c968511e96..aa5740c8a0 100644
--- a/sunrpc/pmap_clnt.c
+++ b/sunrpc/pmap_clnt.c
@@ -57,7 +57,7 @@ __get_myaddress (struct sockaddr_in *addr)
{
struct ifaddrs *ifa;
- if (getifaddrs (&ifa) == 0)
+ if (getifaddrs (&ifa) != 0)
{
perror ("get_myaddress: getifaddrs");
exit (1);
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
index e446f5e608..4ff707ad15 100644
--- a/sunrpc/pmap_rmt.c
+++ b/sunrpc/pmap_rmt.c
@@ -179,7 +179,7 @@ getbroadcastnets (struct in_addr *addrs, int naddrs)
{
struct ifaddrs *ifa;
- if (getifaddrs (&ifa) == 0)
+ if (getifaddrs (&ifa) != 0)
{
perror ("broadcast: getifaddrs");
return 0;
diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h
index 64ac42fc5b..ba9691d1af 100644
--- a/sunrpc/rpc/xdr.h
+++ b/sunrpc/rpc/xdr.h
@@ -303,6 +303,8 @@ extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW;
extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW;
extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW;
extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW;
+extern bool_t xdr_quad_t (XDR *__xdrs, quad_t *__ip) __THROW;
+extern bool_t xdr_u_quad_t (XDR *__xdrs, u_quad_t *__up) __THROW;
extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW;
extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW;
extern bool_t xdr_array (XDR * _xdrs, caddr_t *__addrp, u_int *__sizep,
diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
index b036aa456d..d6eda42309 100644
--- a/sunrpc/rpc_parse.c
+++ b/sunrpc/rpc_parse.c
@@ -621,10 +621,10 @@ get_type (const char **prefixp, const char **typep, defkind dkind)
*typep = "long";
(void) peekscan (TOK_INT, &tok);
break;
- case TOK_HYPER:
- *typep = "int64_t";
+ case TOK_HYPER:
+ *typep = "quad_t";
(void) peekscan(TOK_INT, &tok);
- break;
+ break;
case TOK_VOID:
if (dkind != DEF_UNION && dkind != DEF_PROGRAM)
{
@@ -668,11 +668,11 @@ unsigned_dec (const char **typep)
*typep = "u_long";
(void) peekscan (TOK_INT, &tok);
break;
- case TOK_HYPER:
+ case TOK_HYPER:
get_token (&tok);
- *typep = "uint64_t";
+ *typep = "u_quad_t";
(void) peekscan(TOK_INT, &tok);
- break;
+ break;
case TOK_INT:
get_token (&tok);
*typep = "u_int";
diff --git a/sunrpc/tst-getmyaddr.c b/sunrpc/tst-getmyaddr.c
new file mode 100644
index 0000000000..1eaf9b22ca
--- /dev/null
+++ b/sunrpc/tst-getmyaddr.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <rpc/clnt.h>
+
+
+static int
+do_test (void)
+{
+ struct sockaddr_in ad;
+ struct sockaddr_in ad2;
+ memset (&ad, '\0', sizeof (ad));
+ memset (&ad2, '\0', sizeof (ad2));
+
+ get_myaddress (&ad);
+
+ printf ("addr = %s:%d\n", inet_ntoa (ad.sin_addr), ad.sin_port);
+
+ return memcmp (&ad, &ad2, sizeof (ad)) == 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sunrpc/xdr_intXX_t.c b/sunrpc/xdr_intXX_t.c
index d36d1623bc..9d2f92e10d 100644
--- a/sunrpc/xdr_intXX_t.c
+++ b/sunrpc/xdr_intXX_t.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
@@ -18,7 +18,14 @@
02111-1307 USA. */
#include <rpc/types.h>
+
+/* We play dirty tricks with aliases. */
+#define xdr_quad_t Xdr_quad_t
+#define xdr_u_quad_t Xdr_u_quad_t
#include <rpc/xdr.h>
+#undef xdr_quad_t
+#undef xdr_u_quad_t
+
/* XDR 64bit integers */
bool_t
@@ -47,6 +54,7 @@ xdr_int64_t (XDR *xdrs, int64_t *ip)
return FALSE;
}
}
+strong_alias (xdr_int64_t, xdr_quad_t)
/* XDR 64bit unsigned integers */
bool_t
@@ -75,6 +83,7 @@ xdr_uint64_t (XDR *xdrs, uint64_t *uip)
return FALSE;
}
}
+strong_alias (xdr_int64_t, xdr_u_quad_t)
/* XDR 32bit integers */
bool_t