aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:23 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:23 +0000
commit36fb372264a85da3f86b4750dd7ba0bdb3d2e967 (patch)
treeb34811fbd930b562186c80c95ad4e917fde5445d
parenta56881d3e942b46e3bfb01199000c3cac25ccff2 (diff)
downloadsrc-36fb372264a85da3f86b4750dd7ba0bdb3d2e967.tar.gz
src-36fb372264a85da3f86b4750dd7ba0bdb3d2e967.zip
kern: Move variables only used for MAC under #ifdef MAC.
-rw-r--r--sys/kern/sys_pipe.c4
-rw-r--r--sys/kern/sys_socket.c5
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;