]> git.ipfire.org Git - thirdparty/dhcpcd.git/commit
dhcpcd: Redirect stdout/stderr to the launcher stderr descriptor
authorRoy Marples <roy@marples.name>
Sun, 6 Sep 2020 01:41:08 +0000 (02:41 +0100)
committerRoy Marples <roy@marples.name>
Sun, 6 Sep 2020 01:41:08 +0000 (02:41 +0100)
commit71b878695ef0557a036fee35997e52cd1f3d2aea
treeb9ebe3c4510a00663e8b6993c39c3a35b7bafde1
parente80f2a5aeaf2e249ca6b6a10090f64c69ea99719
dhcpcd: Redirect stdout/stderr to the launcher stderr descriptor

This actually make life really simple!
We no longer need to redirect stdout/stderr to /dev/null for privsep
and any script output is now captured again - and it all goes to stderr
as it should even if a script wants it to go to stdout.

On the happy path, only the master process will actually log anything
to stderr so we turn that off after we "fork".
On the unhappy path, logging to stderr/stdout *may* fail because
the launcher process *may* have exited.
We *could* have the master process as an intermediary but that's
just excess code to avoid errors which *should* not happen.
Regardless, any errror should still hit syslog.
src/dhcpcd.c
src/logerr.c
src/logerr.h
src/privsep.c