Skip to content

Commit

Permalink
Move daemon() after proc_setup() to sync with other proc.c daemons.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobhe committed Apr 8, 2024
1 parent dac1ed2 commit 2a1b622
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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 <reyk@openbsd.org>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a1b622

Please sign in to comment.