summary refs log tree commit diff
path: root/sunrpc/svc_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/svc_unix.c')
-rw-r--r--sunrpc/svc_unix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index a8ed53463e..c42d30ed83 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -307,7 +307,10 @@ __msgread (int sock, void *buf, size_t cnt)
   msg.msg_controllen = sizeof (struct cmessage);
   msg.msg_flags = 0;
 
-  setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on));
+#ifdef SO_PASSCRED
+  if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
+    return -1;
+#endif
 
   return recvmsg (sock, &msg, 0);
 }