Hi Matt,

Matt Fisher wrote on Thu, Oct 15, 2009 at 11:39:39PM -0400:

> Stuart Henderson referred me to the tech list for this question.
> 
> Here's a diff showing one line of possible cruft deleted from m4.
> This is one of 9 similar occurrences I've found in the src tree.

I guess you are changing semantics.

> $ cd /usr/src/usr.bin/m4
> $ diff -u main.c main.c.new
> --- main.c      Thu Oct 15 21:42:14 2009
> +++ main.c.new  Wed Oct 15 23:37:01 2009
> @@ -172,8 +172,7 @@
>         int n;
>         char *p;
> 
> -       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
> -               signal(SIGINT, onintr);

As far as i understand, that means:
 "In case SIGINT is being ignored at the time m4 is invoked,
  continue ignoring it.
  In case it is not being ignored at startup time,
  replace the existing handler by the function onintr."

> +       signal(SIGINT, onintr);

That means:
 "Always install onintr as the signal handler,
  even in case SIGINT is currently being ignored."

So, if i'm understanding correctly, you are removing the option
to ignore SIGINT while running m4.

> A few days back I asked the misc list if such code should be *added*.

As an aside, you didn't say where, or why.

> Theo replied this isn't necessary in BSD.

No, Theo wrote:

  "I assume you are talking about resetting the signals when
   they are caught.  That is not required in BSD unix."

It is *now* clear this was _not_ what you were talking about,
so Theo's answer doesn't apply.
In fact, you gave no context, so it was not obvious what you
were talking about.

> So I've concluded that
> existing code like this could in fact be deleted.

At least for the case at hand, i doubt that, but i do not know
that much about signal handling, so i would certainly not dare
to attempt cleanups in that region.

> Is that right?
> Anybody want to see more diffs for deleted cruft?

Thanks, not me.  ;)

Yours,
  Ingo

Reply via email to