about summary refs log tree commit diff
path: root/sunrpc/clnt_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/clnt_unix.c')
-rw-r--r--sunrpc/clnt_unix.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c
index 365bdace3f..cead72b761 100644
--- a/sunrpc/clnt_unix.c
+++ b/sunrpc/clnt_unix.c
@@ -445,7 +445,6 @@ __msgread (int sock, void *buf, size_t cnt)
   struct iovec iov[1];
   struct msghdr msg;
   struct cmessage cm;
-  int on = 1;
 
   iov[0].iov_base = buf;
   iov[0].iov_len = cnt;
@@ -459,8 +458,11 @@ __msgread (int sock, void *buf, size_t cnt)
   msg.msg_flags = 0;
 
 #ifdef SO_PASSCRED
-  if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
-    return -1;
+  {
+    int on = 1;
+    if (setsockopt (sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof (on)))
+      return -1;
+  }
 #endif
 
   return recvmsg (sock, &msg, 0);