summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmd/vmd.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-09-10 10:36:01 +0000
committerbluhm <bluhm@openbsd.org>2018-09-10 10:36:01 +0000
commita9955862d6f72f7052d014379ab8b79e9489dbd5 (patch)
tree02467827ba66427cc1a98054af6bded282e79d61 /usr.sbin/vmd/vmd.c
parentfix typo in the length of the essid we want to switch to (diff)
downloadwireguard-openbsd-a9955862d6f72f7052d014379ab8b79e9489dbd5.tar.xz
wireguard-openbsd-a9955862d6f72f7052d014379ab8b79e9489dbd5.zip
During the fork+exec implementation, daemon(3) was moved after
proc_init(). As a consequence vmd(8) child processes did not detach from the terminal anymore. Dup /dev/null to the stdio file descriptors in the children. OK mlarkin@ reyk@
Diffstat (limited to 'usr.sbin/vmd/vmd.c')
-rw-r--r--usr.sbin/vmd/vmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c
index 2b07a8463b7..ac4d1635bd4 100644
--- a/usr.sbin/vmd/vmd.c
+++ b/usr.sbin/vmd/vmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmd.c,v 1.98 2018/07/15 14:36:54 reyk Exp $ */
+/* $OpenBSD: vmd.c,v 1.99 2018/09/10 10:36:01 bluhm Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -792,7 +792,8 @@ main(int argc, char **argv)
ps->ps_title[proc_id] = title;
/* only the parent returns */
- proc_init(ps, procs, nitems(procs), argc0, argv, proc_id);
+ proc_init(ps, procs, nitems(procs), env->vmd_debug, argc0, argv,
+ proc_id);
log_procinit("parent");
if (!env->vmd_debug && daemon(0, 0) == -1)