bin/65892: ee(1) endless loop
Alex Vasylenko
lxv at omut.org
Wed Jun 23 21:41:03 GMT 2004
The following reply was made to PR bin/65892; it has been noted by GNATS.
From: Alex Vasylenko <lxv at omut.org>
To: freebsd-gnats-submit at FreeBSD.org, eugen at grosbein.pp.ru
Cc:
Subject: Re: bin/65892: ee(1) endless loop
Date: Wed, 23 Jun 2004 17:34:36 -0400
This is a multi-part message in MIME format.
--------------090303020200050609060303
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Eugene Grosbein wrote:
> There are situations when ee(1) starts to eat all CPU cycles.
> ee /tmp/file &
- the code sets to ignore (SIG_IGN) first 23 signals including SIGTTIN,
SIGTTOU;
> ee </dev/null
- the code doesn't check STDIN_FILENO, STDOUT_FILENO for isatty;
Please see the patch.
--
Alex.
--------------090303020200050609060303
Content-Type: text/plain;
name="ee.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ee.c.diff"
--- ee.c.orig Mon Jun 30 07:51:21 2003
+++ ee.c Wed Jun 23 17:02:28 2004
@@ -544,10 +544,11 @@ main(argc, argv) /* beginning of main p
int argc;
char *argv[];
{
- int counter;
-
- for (counter = 1; counter < 24; counter++)
- signal(counter, SIG_IGN);
+ /* Always read from (and write to) a terminal. */
+ if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) {
+ fprintf(stderr, "ee's standard input and output must be a terminal\n");
+ exit(1);
+ }
signal(SIGCHLD, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
--------------090303020200050609060303--
More information about the freebsd-bugs
mailing list