1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Move daemon() after proc_setup() to sync with other proc.c daemons.

This commit is contained in:
tobhe 2024-04-08 12:50:05 +00:00
parent dac1ed2549
commit 2a1b622220

View File

@ -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>
@ -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