summaryrefslogtreecommitdiffstats
path: root/support/nfs/svc_socket.c
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2015-11-18 11:44:27 -0500
committerSteve Dickson <steved@redhat.com>2015-11-20 10:14:09 -0500
commit1d8d4e469d02aa574cb8529651809c0be90c3923 (patch)
tree6aadc84e6c6710ccdbf0ac7e33706e8f5465cccc /support/nfs/svc_socket.c
parentbe40202f194877306c19929479114b90a08363c1 (diff)
downloadnfs-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_socket.c')
-rw-r--r--support/nfs/svc_socket.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/support/nfs/svc_socket.c b/support/nfs/svc_socket.c
index 99321e7..1fa0d15 100644
--- a/support/nfs/svc_socket.c
+++ b/support/nfs/svc_socket.c
@@ -24,6 +24,7 @@
#include <sys/socket.h>
#include <sys/fcntl.h>
#include <errno.h>
+#include "xlog.h"
#include "config.h"
@@ -99,9 +100,9 @@ svcsock_nonblock(int sock)
* connection.
*/
if ((flags = fcntl(sock, F_GETFL)) < 0)
- perror(_("svc_socket: can't get socket flags"));
+ xlog(L_ERROR, "svc_socket: can't get socket flags: %m");
else if (fcntl(sock, F_SETFL, flags|O_NONBLOCK) < 0)
- perror(_("svc_socket: can't set socket flags"));
+ xlog(L_ERROR, "svc_socket: can't set socket flags: %m");
else
return sock;
@@ -119,7 +120,7 @@ svc_socket (u_long number, int type, int protocol, int reuse)
if ((sock = __socket (AF_INET, type, protocol)) < 0)
{
- perror (_("svc_socket: socket creation problem"));
+ xlog(L_ERROR, "svc_socket: socket creation problem: %m");
return sock;
}
@@ -130,7 +131,7 @@ svc_socket (u_long number, int type, int protocol, int reuse)
sizeof (ret));
if (ret < 0)
{
- perror (_("svc_socket: socket reuse problem"));
+ xlog(L_ERROR, "svc_socket: socket reuse problem: %m");
return ret;
}
}
@@ -141,7 +142,7 @@ svc_socket (u_long number, int type, int protocol, int reuse)
if (bind(sock, (struct sockaddr *) &addr, len) < 0)
{
- perror (_("svc_socket: bind problem"));
+ xlog(L_ERROR, "svc_socket: bind problem: %m");
(void) __close(sock);
sock = -1;
}