Skip to contentSkip to conversation

signal.c: convert assertion to BUG_ON()

PATCH Pavel Machek 2 participants 2 messages Dec 25, 2004

lore
Share & tools
lore
#0 lore raw

Hi!

Convert assertion code to BUG_ON(). Please apply,
Pavel

kernel/signal.c +1 -2
@@ -1442,8 +1442,7 @@
 	unsigned long flags;
 	struct sighand_struct *psig;
 
-	if (sig == -1)
-		BUG();
+	BUG_ON(sig == -1);
 
  	/* do_notify_parent_cldstop should have been called instead.  */
  	BUG_ON(tsk->state & (TASK_STOPPED|TASK_TRACED));
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#1 lore raw

kernel/signal.c line 1445

Quoted 3 lines
kernel/signal.c +1 -2
-	if (sig == -1)
-		BUG();
+	BUG_ON(sig == -1);

Can sig be < -1? If not, this should probably be BUG_ON(sig < 0) (common defensive coding rule...)

Olaf