summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorart <art@openbsd.org>2001-04-01 21:30:32 +0000
committerart <art@openbsd.org>2001-04-01 21:30:32 +0000
commit1bdf816e5bb68dad6d0aab5e7704e37908ec48ba (patch)
tree052dc2faafd3def720ab0ed14b1064b64ed2a54c
parentif we have a secondary fontset loaded and it (diff)
downloadwireguard-openbsd-1bdf816e5bb68dad6d0aab5e7704e37908ec48ba.tar.xz
wireguard-openbsd-1bdf816e5bb68dad6d0aab5e7704e37908ec48ba.zip
Add a macro to initialize the contents of a vmcmd set.
Correctly initialize the vmcmds in linux_exec.
-rw-r--r--sys/compat/linux/linux_exec.c5
-rw-r--r--sys/kern/kern_exec.c6
-rw-r--r--sys/sys/exec.h11
3 files changed, 13 insertions, 9 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c
index a71748d38d0..02a4fd56ca3 100644
--- a/sys/compat/linux/linux_exec.c
+++ b/sys/compat/linux/linux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.c,v 1.14 2000/11/10 15:33:09 provos Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.15 2001/04/01 21:30:33 art Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*
@@ -478,8 +478,7 @@ linux_sys_uselib(p, v, retval)
}
vp->v_flag |= VTEXT;
- vcset.evs_cnt = 0;
- vcset.evs_used = 0;
+ VMCMDSET_INIT(&vcset);
NEW_VMCMD(
&vcset, magic == ZMAGIC ? vmcmd_map_readvn : vmcmd_map_pagedvn,
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 3344e664d33..0b44d27d700 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.47 2001/02/22 16:08:01 art Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.48 2001/04/01 21:30:33 art Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -269,9 +269,7 @@ sys_execve(p, v, retval)
pack.ep_hdrvalid = 0;
pack.ep_ndp = &nid;
pack.ep_emul_arg = NULL;
- pack.ep_vmcmds.evs_cnt = EXEC_DEFAULT_VMCMD_SETSIZE;
- pack.ep_vmcmds.evs_cmds = pack.ep_vmcmds.evs_start;
- pack.ep_vmcmds.evs_used = 0;
+ VMCMDSET_INIT(&pack.ep_vmcmds);
pack.ep_vap = &attr;
pack.ep_emul = &emul_native;
pack.ep_flags = 0;
diff --git a/sys/sys/exec.h b/sys/sys/exec.h
index a95060bfe41..3d8e1e3c55b 100644
--- a/sys/sys/exec.h
+++ b/sys/sys/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.9 2001/02/22 16:08:01 art Exp $ */
+/* $OpenBSD: exec.h,v 1.10 2001/04/01 21:30:32 art Exp $ */
/* $NetBSD: exec.h,v 1.59 1996/02/09 18:25:09 christos Exp $ */
/*-
@@ -209,7 +209,14 @@ void new_vmcmd __P((struct exec_vmcmd_set *evsp,
vcp->ev_offset = (offset); \
vcp->ev_prot = (prot); \
}
-#endif /* EXEC_DEBUG */
+#endif /* DEBUG */
+
+/* Initialize an empty vmcmd set */
+#define VMCMDSET_INIT(vmc) do { \
+ (vmc)->evs_cnt = EXEC_DEFAULT_VMCMD_SETSIZE; \
+ (vmc)->evs_cmds = (vmc)->evs_start; \
+ (vmc)->evs_used = 0; \
+} while (0)
/*
* Exec function switch: