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: Robert Elz
Subject: Re: [nmh-workers] closefds() _before_ fork?
Date: Wed, 24 Apr 2019 00:01:08 +0700

    Date:        Tue, 23 Apr 2019 11:15:05 -0400
    From:        "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" <address@hidden>
    Message-ID:  <address@hidden>

  | 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




reply via email to

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