chiark / gitweb /
server/tripe.c: Be more clever about when to switch error output.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 12 May 2018 23:36:36 +0000 (00:36 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 25 Jan 2019 12:10:31 +0000 (12:10 +0000)
commita47e5f929c244078a87c737ae99294fecfb269c0
tree491b7152e4f2ab2daebe7414968c1847bdd13e6a
parentcc807016aa6f35f6f9bbb03f75a31ba5045a262c
server/tripe.c: Be more clever about when to switch error output.

If we're going to detach and be a daemon, then we don't adopt
stdin/stdout as an initial administration client -- because we're going
to close these streams and disassociate from the surrounding
environment.  On the other hand, if we /are/ going to adopt
stdin/stdout, it makes sense to report errors to the client listening
there as soon as we can, so that they can keep informed of our
progress.  So take advantage of the new flexibility afforded by the
`a_switcherr' function, and switch the error output early or late
depending on whether we're going to daemonize.
server/tripe.c