git: 36fb372264a8 - main - kern: Move variables only used for MAC under #ifdef MAC.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 13 Apr 2022 23:10:07 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=36fb372264a85da3f86b4750dd7ba0bdb3d2e967
commit 36fb372264a85da3f86b4750dd7ba0bdb3d2e967
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:23 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:23 +0000
kern: Move variables only used for MAC under #ifdef MAC.
---
sys/kern/sys_pipe.c | 4 ++++
sys/kern/sys_socket.c | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 1d5d7329692e..32ed17c0fe23 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1646,14 +1646,18 @@ pipe_free_kmem(struct pipe *cpipe)
static void
pipeclose(struct pipe *cpipe)
{
+#ifdef MAC
struct pipepair *pp;
+#endif
struct pipe *ppipe;
KASSERT(cpipe != NULL, ("pipeclose: cpipe == NULL"));
PIPE_LOCK(cpipe);
pipelock(cpipe, 0);
+#ifdef MAC
pp = cpipe->pipe_pair;
+#endif
/*
* If the other side is blocked, wake it up saying that
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 4e752fa6b664..774b317c6ecb 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -597,7 +597,9 @@ soaio_process_job(struct socket *so, struct sockbuf *sb, struct kaiocb *job)
{
struct ucred *td_savedcred;
struct thread *td;
- struct file *fp;
+#ifdef MAC
+ struct file *fp = job->fd_file;
+#endif
size_t cnt, done, job_total_nbytes __diagused;
long ru_before;
int error, flags;
@@ -605,7 +607,6 @@ soaio_process_job(struct socket *so, struct sockbuf *sb, struct kaiocb *job)
SOCKBUF_UNLOCK(sb);
aio_switch_vmspace(job);
td = curthread;
- fp = job->fd_file;
retry:
td_savedcred = td->td_ucred;
td->td_ucred = job->cred;