summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2016-09-28 12:01:04 +0000
committerreyk <reyk@openbsd.org>2016-09-28 12:01:04 +0000
commit69b8d8bcea718bb082cc06593dd57afbc4c0223c (patch)
treecdf995877522c5f25e8ff47194a08e9399d57787
parentDo not close stdout when starting netcat, redirect to /dev/null (diff)
downloadwireguard-openbsd-69b8d8bcea718bb082cc06593dd57afbc4c0223c.tar.xz
wireguard-openbsd-69b8d8bcea718bb082cc06593dd57afbc4c0223c.zip
sync proc.c from switchd, includes minor cast qual fix and removal of p_env.
-rw-r--r--usr.sbin/httpd/httpd.c8
-rw-r--r--usr.sbin/httpd/httpd.h5
-rw-r--r--usr.sbin/httpd/proc.c5
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c
index 2a279632557..3f73a520382 100644
--- a/usr.sbin/httpd/httpd.c
+++ b/usr.sbin/httpd/httpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: httpd.c,v 1.61 2016/09/02 11:25:14 reyk Exp $ */
+/* $OpenBSD: httpd.c,v 1.62 2016/09/28 12:01:04 reyk Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -398,7 +398,8 @@ parent_shutdown(struct httpd *env)
int
parent_dispatch_server(int fd, struct privsep_proc *p, struct imsg *imsg)
{
- struct httpd *env = p->p_env;
+ struct privsep *ps = p->p_ps;
+ struct httpd *env = ps->ps_env;
switch (imsg->hdr.type) {
case IMSG_CFG_DONE:
@@ -414,7 +415,8 @@ parent_dispatch_server(int fd, struct privsep_proc *p, struct imsg *imsg)
int
parent_dispatch_logger(int fd, struct privsep_proc *p, struct imsg *imsg)
{
- struct httpd *env = p->p_env;
+ struct privsep *ps = p->p_ps;
+ struct httpd *env = ps->ps_env;
unsigned int v;
char *str = NULL;
diff --git a/usr.sbin/httpd/httpd.h b/usr.sbin/httpd/httpd.h
index 59078a15d1f..3b3d157932d 100644
--- a/usr.sbin/httpd/httpd.h
+++ b/usr.sbin/httpd/httpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: httpd.h,v 1.119 2016/09/03 14:44:21 reyk Exp $ */
+/* $OpenBSD: httpd.h,v 1.120 2016/09/28 12:01:04 reyk Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -267,10 +267,9 @@ struct privsep_proc {
struct imsg *);
void (*p_init)(struct privsep *,
struct privsep_proc *);
- void (*p_shutdown)(void);
const char *p_chroot;
struct privsep *p_ps;
- struct httpd *p_env;
+ void (*p_shutdown)(void);
};
struct privsep_fd {
diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c
index b505d364a8c..5ea7e5f4eb9 100644
--- a/usr.sbin/httpd/proc.c
+++ b/usr.sbin/httpd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.26 2016/09/03 14:44:21 reyk Exp $ */
+/* $OpenBSD: proc.c,v 1.27 2016/09/28 12:01:04 reyk Exp $ */
/*
* Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -115,7 +115,7 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc,
p = &procs[proc];
/* Update args with process title. */
- nargv[proc_i] = (char *) p->p_title;
+ nargv[proc_i] = (char *)(uintptr_t)p->p_title;
/* Fire children processes. */
for (i = 0; i < ps->ps_instances[p->p_id]; i++) {
@@ -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;