From 7d5960753eb0b931f8b51118aadd69b8fab955cc Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Tue, 3 Feb 2015 11:06:22 -0500 Subject: rpcbind: init_transport cleanup In init_transport, move creation of COTS sockets closer to where they are used Signed-off-by: Olaf Kirch Signed-off-by: Steve Dickson --- src/rpcbind.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/rpcbind.c b/src/rpcbind.c index 0c81e8c..e23a957 100644 --- a/src/rpcbind.c +++ b/src/rpcbind.c @@ -425,18 +425,6 @@ init_transport(struct netconfig *nconf) if (my_xprt != NULL) goto got_socket; - /* - * XXX - using RPC library internal functions. For NC_TPI_CLTS - * we call this later, for each socket we like to bind. - */ - if (nconf->nc_semantics != NC_TPI_CLTS) { - if ((fd = __rpc_nconf2fd(nconf)) < 0) { - syslog(LOG_ERR, "cannot create socket for %s", - nconf->nc_netid); - return (1); - } - } - if ((strcmp(nconf->nc_netid, "local") == 0) || (strcmp(nconf->nc_netid, "unix") == 0)) { memset(&sun, 0, sizeof sun); @@ -597,6 +585,12 @@ init_transport(struct netconfig *nconf) if (!checkbind) return 1; } else { /* NC_TPI_COTS */ + if ((fd = __rpc_nconf2fd(nconf)) < 0) { + syslog(LOG_ERR, "cannot create socket for %s", + nconf->nc_netid); + return (1); + } + if ((strcmp(nconf->nc_netid, "local") != 0) && (strcmp(nconf->nc_netid, "unix") != 0)) { if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) { -- cgit v1.2.1