From 2a1b6222200eb1b3baf34e048f68e24efed9ac56 Mon Sep 17 00:00:00 2001 From: tobhe Date: Mon, 8 Apr 2024 12:50:05 +0000 Subject: [PATCH] Move daemon() after proc_setup() to sync with other proc.c daemons. --- sbin/iked/proc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c index 534427b2b65..18679918268 100644 --- a/sbin/iked/proc.c +++ b/sbin/iked/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.42 2024/02/15 20:10:45 tobhe Exp $ */ +/* $OpenBSD: proc.c,v 1.43 2024/04/08 12:50:05 tobhe Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter @@ -231,9 +231,10 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, if (proc_id == PROC_PARENT) { privsep_process = PROC_PARENT; + proc_setup(ps, procs, nproc); + if (!debug && daemon(0, 0) == -1) fatal("failed to daemonize"); - proc_setup(ps, procs, nproc); /* * Create the children sockets so we can use them -- 2.20.1