* sunrpc/svc_unix.c (__msgread): Move ON local var inside block
within #ifdef SO_PASSCRED. Avoids unused var when no SO_PASSCRED.
* sunrpc/clnt_unix.c (__msgread): Likewise.
struct iovec iov[1];
struct msghdr msg;
struct cmessage cm;
- int on = 1;
iov[0].iov_base = buf;
iov[0].iov_len = 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);
{
struct iovec iov[1];
struct msghdr msg;
- int on = 1;
iov[0].iov_base = buf;
iov[0].iov_len = 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);