diff options
author | Steve Dickson <steved@redhat.com> | 2015-11-18 11:44:27 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-11-20 10:14:09 -0500 |
commit | 1d8d4e469d02aa574cb8529651809c0be90c3923 (patch) | |
tree | 6aadc84e6c6710ccdbf0ac7e33706e8f5465cccc /support/nfs/svc_create.c | |
parent | be40202f194877306c19929479114b90a08363c1 (diff) | |
download | nfs-utils-1d8d4e469d02aa574cb8529651809c0be90c3923.tar.gz nfs-utils-1d8d4e469d02aa574cb8529651809c0be90c3923.tar.xz nfs-utils-1d8d4e469d02aa574cb8529651809c0be90c3923.zip |
svc_create.c: Make sure errors are logged
To help debug rpcbind failures, make sure all
errors are logged and log as much info about
the error as possible.
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs/svc_create.c')
-rw-r--r-- | support/nfs/svc_create.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/support/nfs/svc_create.c b/support/nfs/svc_create.c index 5cb5ff6..ef7ff05 100644 --- a/support/nfs/svc_create.c +++ b/support/nfs/svc_create.c @@ -133,7 +133,7 @@ svc_create_bindaddr(struct netconfig *nconf, const uint16_t port) hint.ai_family = AF_INET6; #endif /* IPV6_SUPPORTED */ else { - xlog(D_GENERAL, "Unrecognized bind address family: %s", + xlog(L_ERROR, "Unrecognized bind address family: %s", nconf->nc_protofmly); return NULL; } @@ -143,7 +143,7 @@ svc_create_bindaddr(struct netconfig *nconf, const uint16_t port) else if (strcmp(nconf->nc_proto, NC_TCP) == 0) hint.ai_protocol = (int)IPPROTO_TCP; else { - xlog(D_GENERAL, "Unrecognized bind address protocol: %s", + xlog(L_ERROR, "Unrecognized bind address protocol: %s", nconf->nc_proto); return NULL; } @@ -275,7 +275,7 @@ svc_create_nconf_rand_port(const char *name, const rpcprog_t program, xprt = svc_tli_create(RPC_ANYFD, nconf, &bindaddr, 0, 0); freeaddrinfo(ai); if (xprt == NULL) { - xlog(D_GENERAL, "Failed to create listener xprt " + xlog(L_ERROR, "Failed to create listener xprt " "(%s, %u, %s)", name, version, nconf->nc_netid); return 0; } @@ -286,10 +286,12 @@ svc_create_nconf_rand_port(const char *name, const rpcprog_t program, return 0; } + rpc_createerr.cf_stat = rpc_createerr.cf_error.re_errno = 0; if (!svc_reg(xprt, program, version, dispatch, nconf)) { /* svc_reg(3) destroys @xprt in this case */ - xlog(D_GENERAL, "Failed to register (%s, %u, %s)", - name, version, nconf->nc_netid); + xlog(L_ERROR, "Failed to register (%s, %u, %s): %s", + name, version, nconf->nc_netid, + clnt_spcreateerror("svc_reg() err")); return 0; } |