Re: [PATCH v4 15/15] daemon: opt-out on features that require posix
- From
Erik Faye-Lund <kusmabite@gmail.com>
- Date
- Oct 21, 2010, 20:37 UTC
- Message-ID
- <AANLkTikJXaqDH6vJzPna7txssMO67SxmVy_Nvu2SW46W@mail.gmail.com>
- In-Reply-To
- <1286833829-5116-16-git-send-email-kusmabite@gmail.com>
On Mon, Oct 11, 2010 at 11:50 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:
Show 13 quoted lines
> @@ -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)