From: Erik Faye-Lund Date: Thu, 21 Oct 2010 20:37:44 GMT Subject: Re: [PATCH v4 15/15] daemon: opt-out on features that require posix Message-ID: In-Reply-To: <1286833829-5116-16-git-send-email-kusmabite@gmail.com> On Mon, Oct 11, 2010 at 11:50 PM, Erik Faye-Lund wrote: > @@ -1168,11 +1185,13 @@ int main(int argc, char **argv) >                return execute(); >        } > > +#ifndef NO_POSIX_GOODIES >        if (detach) { >                daemonize(); >                loginfo("Ready to rumble"); >        } >        else > +#endif >                sanitize_stdfds(); > Does anyone know what the call to sanitize_stdfds() is good for? I tried searching the mailing list, but the discussion on the patch that introduced it seems to only discuss how to implement sanitize_stdfds(), not why... I understand that it might be beneficial in the --detach code-path, but how can stdint, stdout or stderr be closed in this code-path? (CC'ed Matthias, who wrote the code)