From e7f534f494af02cdd506c861185b2c6dc583d4a1 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Sun, 18 Sep 2016 13:17:41 +0000 Subject: Kill p_env from proc.c. The p_env variable was not being used seriously and it was always a copy of ps->ps_env. You might access the env variable now with: p->p_ps->ps_env. ok reyk@ --- usr.sbin/switchd/proc.c | 3 +-- usr.sbin/switchd/proc.h | 3 +-- usr.sbin/switchd/switch.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'usr.sbin/switchd') diff --git a/usr.sbin/switchd/proc.c b/usr.sbin/switchd/proc.c index 5e3f1b68c5e..34cf1c83344 100644 --- a/usr.sbin/switchd/proc.c +++ b/usr.sbin/switchd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.2 2016/09/14 13:46:51 rzalamena Exp $ */ +/* $OpenBSD: proc.c,v 1.3 2016/09/18 13:17:40 rzalamena Exp $ */ /* * Copyright (c) 2010 - 2014 Reyk Floeter @@ -300,7 +300,6 @@ proc_setup(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc) for (src = 0; src < nproc; src++) { procs[src].p_ps = ps; - procs[src].p_env = ps->ps_env; if (procs[src].p_cb == NULL) procs[src].p_cb = proc_dispatch_null; diff --git a/usr.sbin/switchd/proc.h b/usr.sbin/switchd/proc.h index 12db0a2e500..a2336753a17 100644 --- a/usr.sbin/switchd/proc.h +++ b/usr.sbin/switchd/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.2 2016/09/14 13:46:51 rzalamena Exp $ */ +/* $OpenBSD: proc.h,v 1.3 2016/09/18 13:17:40 rzalamena Exp $ */ /* * Copyright (c) 2010-2015 Reyk Floeter @@ -75,7 +75,6 @@ struct privsep_proc { struct privsep_proc *); const char *p_chroot; struct privsep *p_ps; - void *p_env; void (*p_shutdown)(void); unsigned int p_instance; }; diff --git a/usr.sbin/switchd/switch.c b/usr.sbin/switchd/switch.c index 26efb78736a..285add7bacc 100644 --- a/usr.sbin/switchd/switch.c +++ b/usr.sbin/switchd/switch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switch.c,v 1.2 2016/07/20 20:07:02 reyk Exp $ */ +/* $OpenBSD: switch.c,v 1.3 2016/09/18 13:17:40 rzalamena Exp $ */ /* * Copyright (c) 2013-2016 Reyk Floeter @@ -46,8 +46,8 @@ switch_init(struct switchd *sc) int switch_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg) { - struct switchd *sc = p->p_env; struct privsep *ps = p->p_ps; + struct switchd *sc = ps->ps_env; struct switch_control *sw; struct macaddr *mac; struct iovec iov[2]; -- cgit v1.2.3