Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2002 12:15:03 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@FreeBSD.ORG>
Cc:        current@FreeBSD.ORG
Subject:   Re: kern_sig.c mis-indentation
Message-ID:  <20020929115617.J39631-100000@gamplex.bde.org>
In-Reply-To: <31992.1033227935@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 28 Sep 2002, Poul-Henning Kamp wrote:

> The indentation and the braces look rather odd in this bit of
> kern_sig.c, somebody should straighten it up and check if
> there are any bugs in this:
>
>                               mi_switch();
>                                 mtx_unlock_spin(&sched_lock);
>                                 PICKUP_GIANT();
>                                 PROC_LOCK(p);
>                                 break;
>                         } else
>                              if (prop & SA_IGNORE) {
>                                 /*
>                                  * Except for SIGCONT, shouldn't get here.
>                                  * Default action is to ignore; drop it.
>                                  */
>                                 break;          /* == ignore */
>                         } else
>                                 return (sig);
>                         /*NOTREACHED*/

This seemed to be just sloppy editing when it was first committed.  IIRC,
this was messed up by putting some ifdefed crud in there, and the smaller
than usual indentation for the 'if' was a hack to avoid re-indenting
properly.  The ifdefed crud was soon removed, leaving only the (now
completely bogus) indentation hack.  I never merged these bugs and now
use the following patch which just restores to the unmangled version
which is still byte for byte identical with RELENG_4 here:

%%%
Index: kern_sig.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_sig.c,v
retrieving revision 1.190
diff -u -2 -r1.190 kern_sig.c
--- kern_sig.c	28 Sep 2002 17:14:53 -0000	1.190
+++ kern_sig.c	29 Sep 2002 01:27:20 -0000
@@ -1732,6 +1698,5 @@
 				PROC_LOCK(p);
 				break;
-			} else
-			     if (prop & SA_IGNORE) {
+			} else if (prop & SA_IGNORE) {
 				/*
 				 * Except for SIGCONT, shouldn't get here.
%%%

> PS: Yes, another score by FlexeLint!

Nah.  This was painfully obvious to the non-casual observer :).  I have
1115 more lines of patches for style bugs in this file.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020929115617.J39631-100000>