rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: "David J. Fiander" <golem!david@uunet.UU.NET>
To: rc@archone.tamu.edu
Subject: Re: File descriptor leak.
Date: Sat, 9 Nov 1991 21:50:11 -0600	[thread overview]
Message-ID: <m0kg6Bc-0000eUC@golem.uucp> (raw)
In-Reply-To: Your message of "Sat, 09 Nov 91 22:38:08 EST."


>From:  "David J. Fiander" <david>
>rc slowly opens, and then forgets about file descriptors when
>one uses the "<{cmd}" construct on a system with /dev/fd.  The
>problem is that glom() calls mkcmdarg(), which creates a pipe,
>forks, sets up the child to read from (or write to) the pipe,
>sets the name of the argument for the parent, and then forgets
>about the file.  After the pipeline has terminated (or rc has

More info:  when using named pipes to do all this, rc maintains
a list of fifo file names which it unlinks after the pipeline
has completed.  The code to build the list is all conditionally
compiled in, but the code to clean up is always there
(fortunately, it sees that there is no list of fifos, and just
returns).  The problem can be fixed by adding code to
mkcmdarg() to maintain the fifoq, so that when the pipeline
terminates, empty_fifoq() will _close_ all the pipes that were
created.

How does that sound?

--
David J. Fiander   |A man ought to read just as inclination leads him; for
<david@golem.uucp> |what he reads as a task will do him little good.


             reply	other threads:[~1991-11-10  4:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-11-10  3:50 David J. Fiander [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-11-10  3:38 David J. Fiander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0kg6Bc-0000eUC@golem.uucp \
    --to=golem!david@uunet.uu.net \
    --cc=rc@archone.tamu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).