summaryrefslogtreecommitdiff
path: root/sunrpc/clnt_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/clnt_udp.c')
-rw-r--r--sunrpc/clnt_udp.c66
1 files changed, 17 insertions, 49 deletions
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index 6ffa5f2590..a6cf5f1ca7 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -171,31 +171,7 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs));
if (*sockp < 0)
{
-#ifdef SOCK_NONBLOCK
-# ifndef __ASSUME_SOCK_CLOEXEC
- if (__have_sock_cloexec >= 0)
-# endif
- {
- *sockp = __socket (AF_INET, SOCK_DGRAM|SOCK_NONBLOCK|flags,
- IPPROTO_UDP);
-# ifndef __ASSUME_SOCK_CLOEXEC
- if (__have_sock_cloexec == 0)
- __have_sock_cloexec = *sockp >= 0 || errno != EINVAL ? 1 : -1;
-# endif
- }
-#endif
-#ifndef __ASSUME_SOCK_CLOEXEC
-# ifdef SOCK_CLOEXEC
- if (__have_sock_cloexec < 0)
-# endif
- {
- *sockp = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-# ifdef SOCK_CLOEXEC
- if (flags & SOCK_CLOEXEC)
- __fcntl (*sockp, F_SETFD, FD_CLOEXEC);
-# endif
- }
-#endif
+ *sockp = __socket (AF_INET, SOCK_DGRAM|SOCK_NONBLOCK|flags, IPPROTO_UDP);
if (__glibc_unlikely (*sockp < 0))
{
struct rpc_createerr *ce = &get_rpc_createerr ();
@@ -205,16 +181,6 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
}
/* attempt to bind to prov port */
(void) bindresvport (*sockp, (struct sockaddr_in *) 0);
-#ifndef __ASSUME_SOCK_CLOEXEC
-# ifdef SOCK_CLOEXEC
- if (__have_sock_cloexec < 0)
-# endif
- {
- /* the sockets rpc controls are non-blocking */
- int dontblock = 1;
- (void) __ioctl (*sockp, FIONBIO, (char *) &dontblock);
- }
-#endif
#ifdef IP_RECVERR
{
int on = 1;
@@ -254,12 +220,8 @@ clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
libc_hidden_nolink_sunrpc (clntudp_bufcreate, GLIBC_2_0)
CLIENT *
-clntudp_create (raddr, program, version, wait, sockp)
- struct sockaddr_in *raddr;
- u_long program;
- u_long version;
- struct timeval wait;
- int *sockp;
+clntudp_create (struct sockaddr_in *raddr, u_long program, u_long version,
+ struct timeval wait, int *sockp)
{
return __libc_clntudp_bufcreate (raddr, program, version, wait,
sockp, UDPMSGSIZE, UDPMSGSIZE, 0);
@@ -295,14 +257,20 @@ is_network_up (int sock)
}
static enum clnt_stat
-clntudp_call (cl, proc, xargs, argsp, xresults, resultsp, utimeout)
- CLIENT *cl; /* client handle */
- u_long proc; /* procedure number */
- xdrproc_t xargs; /* xdr routine for args */
- caddr_t argsp; /* pointer to args */
- xdrproc_t xresults; /* xdr routine for results */
- caddr_t resultsp; /* pointer to results */
- struct timeval utimeout; /* seconds to wait before giving up */
+clntudp_call (/* client handle */
+ CLIENT *cl,
+ /* procedure number */
+ u_long proc,
+ /* xdr routine for args */
+ xdrproc_t xargs,
+ /* pointer to args */
+ caddr_t argsp,
+ /* xdr routine for results */
+ xdrproc_t xresults,
+ /* pointer to results */
+ caddr_t resultsp,
+ /* seconds to wait before giving up */
+ struct timeval utimeout)
{
struct cu_data *cu = (struct cu_data *) cl->cl_private;
XDR *xdrs;