Re: [PATCH] Incorrect value for SIGRTMAX

From: eric . piel
Date: Sat Jan 24 2004 - 16:36:41 EST


Hello,

Few months ago, Corey Minyard corrected handling of incorrect values of signals.
cf
http://linux.bkbits.net:8080/linux-2.5/cset@xxxxxxxxxxxx?nav=index.html%7Csrc/%7Csrc/kernel%7Crelated/kernel/posix-timers.c

Working on the High-Resolution Timers project, I noticed there is an error in
good_sigevent() to catch the case when sigev_signo is 0. In this function, we
want to return NULL when sigev_signo is 0. The one liner attached (used for a
long time in the HRT patch) should do the trick, it's against vanilla 2.6.1 .

Eric

--- linux-2.6.1/kernel/posix-timers.c.orig 2004-01-24 15:17:31.645060248 +0100
+++ linux-2.6.1/kernel/posix-timers.c 2004-01-24 15:20:56.977844920 +0100
@@ -344,8 +344,7 @@
return NULL;

if ((event->sigev_notify & ~SIGEV_NONE & MIPS_SIGEV) &&
- event->sigev_signo &&
- ((unsigned) (event->sigev_signo > SIGRTMAX)))
+ ((unsigned) (event->sigev_signo > SIGRTMAX) || !event->sigev_signo))
return NULL;

return rtn;