nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] closefds() _before_ fork?


From: Valdis Klētnieks
Subject: Re: [nmh-workers] closefds() _before_ fork?
Date: Tue, 23 Apr 2019 14:39:48 -0400

On Wed, 24 Apr 2019 00:01:08 +0700, Robert Elz said:

> I don't know why fd 3 was wanted to be a dup of stdin, but aside from
> that oddity, there's notthing remarkable about the code (no WTF), the
> test is just avoiding a (pointless) dup2(3,3).
>
> Whatever fd 3 was before executing this code, it is closed after it
> unless it happened to be what is wanted on stdin.

The point is that the fragment of code doesn't actually *know* "it happened
to be what is wanted on stdin". For all this code knows, it's a dangling fd
that was opened by some library function to talk to dbus or something.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]