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.

$ 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);
+       signal(SIGINT, onintr);

        init_macros();
        initspaces();

If I understand correctly, the original code is setting a signal
behavior in order to check a signal behavior. I think the idea is to
only handle SIGINT if not ignoring it -- for example, to only catch ^C
when in the foreground.

A few days back I asked the misc list if such code should be *added*.
Theo replied this isn't necessary in BSD. So I've concluded that
existing code like this could in fact be deleted.

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

Thanks.
-- 
Matt Fisher <mfisher...@maine.rr.com>

Reply via email to