aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/pm_getmaps.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sunrpc/pm_getmaps.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.zip
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sunrpc/pm_getmaps.c')
-rw-r--r--sunrpc/pm_getmaps.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sunrpc/pm_getmaps.c b/sunrpc/pm_getmaps.c
index 2a6876d..d1d4ca8 100644
--- a/sunrpc/pm_getmaps.c
+++ b/sunrpc/pm_getmaps.c
@@ -44,12 +44,9 @@ static char sccsid[] = "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <netdb.h>
-#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#include <libintl.h>
-#include <unistd.h>
-
/*
* Get a copy of the current port maps.
@@ -59,19 +56,13 @@ struct pmaplist *
pmap_getmaps (struct sockaddr_in *address)
{
struct pmaplist *head = (struct pmaplist *) NULL;
+ int socket = -1;
struct timeval minutetimeout;
CLIENT *client;
- bool closeit = false;
minutetimeout.tv_sec = 60;
minutetimeout.tv_usec = 0;
address->sin_port = htons (PMAPPORT);
-
- /* Don't need a reserved port to get ports from the portmapper. */
- int socket = __get_socket (address);
- if (socket != -1)
- closeit = true;
-
client = INTUSE(clnttcp_create) (address, PMAPPROG,
PMAPVERS, &socket, 50, 500);
if (client != (CLIENT *) NULL)
@@ -84,9 +75,7 @@ pmap_getmaps (struct sockaddr_in *address)
}
CLNT_DESTROY (client);
}
- /* We only need to close the socket here if we opened it. */
- if (closeit)
- (void) __close (socket);
+ /* (void)close(socket); CLNT_DESTROY already closed it */
address->sin_port = 0;
return head;
}