nmh-workers
[Top] [All Lists]

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

2019-04-23 12:02:12
    Date:        Tue, 23 Apr 2019 11:15:05 -0400
    From:        "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" <valdis.kletnieks@vt.edu>
    Message-ID:  <4344.1556032505@turing-police>

  | The *real* WTF there is that the code doesn't actually know if fd 3 is
  | known to be open on a file that should, or if it's just a stray leaked fd.

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.

kre


-- 
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>