* [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT @ 2009-10-12 9:39 liubo 2009-10-12 18:28 ` Garrett Cooper 0 siblings, 1 reply; 4+ messages in thread From: liubo @ 2009-10-12 9:39 UTC (permalink / raw) To: ltp-list The test case ppoll01 does not register the signal handler of SIGINT, so the program will be terminated by SIGINT from child process. Then, the rest cases will not be tested. This patch fixed the problem. Signed-off-by: Liu Bo <liubo-fnst@cn.fujitsu.com> --- diff --git a/testcases/kernel/syscalls/ppoll/ppoll01.c b/testcases/kernel/syscalls/ppoll/ppoll01.c index f76d61f..585297c 100644 --- a/testcases/kernel/syscalls/ppoll/ppoll01.c +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c @@ -124,9 +124,17 @@ extern void cleanup() { /* On success - returns 0. */ /* */ /******************************************************************************/ +/* + * sighandler() + */ +void sighandler(int sig) +{ + return; +} void setup() { /* Capture signals if any */ - /* Create temporary directories */ + signal(SIGINT, sighandler); + /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); } @@ -404,16 +412,6 @@ TEST_END: } -/* - * sighandler() - */ -void sighandler(int sig) -{ - if (sig == SIGINT) - return; - // NOTREACHED - return; -} /* ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT 2009-10-12 9:39 [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT liubo @ 2009-10-12 18:28 ` Garrett Cooper 2009-10-12 18:36 ` Mike Frysinger 0 siblings, 1 reply; 4+ messages in thread From: Garrett Cooper @ 2009-10-12 18:28 UTC (permalink / raw) To: liubo; +Cc: ltp-list On Mon, Oct 12, 2009 at 2:39 AM, liubo <liubo-fnst@cn.fujitsu.com> wrote: > The test case ppoll01 does not register the signal handler > of SIGINT, so the program will be terminated by SIGINT > from child process. > > Then, the rest cases will not be tested. > > This patch fixed the problem. > > Signed-off-by: Liu Bo <liubo-fnst@cn.fujitsu.com> > --- > diff --git a/testcases/kernel/syscalls/ppoll/ppoll01.c b/testcases/kernel/syscalls/ppoll/ppoll01.c > index f76d61f..585297c 100644 > --- a/testcases/kernel/syscalls/ppoll/ppoll01.c > +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c > @@ -124,9 +124,17 @@ extern void cleanup() { > /* On success - returns 0. */ > /* */ > /******************************************************************************/ > +/* > + * sighandler() > + */ > +void sighandler(int sig) > +{ > + return; > +} > void setup() { > /* Capture signals if any */ > - /* Create temporary directories */ > + signal(SIGINT, sighandler); > + /* Create temporary directories */ > TEST_PAUSE; > tst_tmpdir(); > } > @@ -404,16 +412,6 @@ TEST_END: > } > > > -/* > - * sighandler() > - */ > -void sighandler(int sig) > -{ > - if (sig == SIGINT) > - return; > - // NOTREACHED > - return; > -} 1. If all that the signal handler does is just return, it should have been doing SIG_IGN from the beginning. 2. I don't understand how your change fixes this because the signal handler's function is almost the same (the original handler was more generic). Thanks, -Garrett ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT 2009-10-12 18:28 ` Garrett Cooper @ 2009-10-12 18:36 ` Mike Frysinger 2009-10-13 9:40 ` liubo 0 siblings, 1 reply; 4+ messages in thread From: Mike Frysinger @ 2009-10-12 18:36 UTC (permalink / raw) To: ltp-list; +Cc: liubo [-- Attachment #1.1: Type: Text/Plain, Size: 1661 bytes --] On Monday 12 October 2009 14:28:02 Garrett Cooper wrote: > On Mon, Oct 12, 2009 at 2:39 AM, liubo <liubo-fnst@cn.fujitsu.com> wrote: > > The test case ppoll01 does not register the signal handler > > of SIGINT, so the program will be terminated by SIGINT > > from child process. > > > > Then, the rest cases will not be tested. > > > > This patch fixed the problem. > > > > --- a/testcases/kernel/syscalls/ppoll/ppoll01.c > > +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c > > @@ -124,9 +124,17 @@ extern void cleanup() { > > +/* > > + * sighandler() > > + */ > > +void sighandler(int sig) > > +{ > > + return; > > +} > > void setup() { > > /* Capture signals if any */ > > - /* Create temporary directories */ > > + signal(SIGINT, sighandler); > > + /* Create temporary directories */ > > TEST_PAUSE; > > tst_tmpdir(); > > } > > @@ -404,16 +412,6 @@ TEST_END: > > } > > > > > > -/* > > - * sighandler() > > - */ > > -void sighandler(int sig) > > -{ > > - if (sig == SIGINT) > > - return; > > - // NOTREACHED > > - return; > > -} > > 1. If all that the signal handler does is just return, it should have > been doing SIG_IGN from the beginning. > 2. I don't understand how your change fixes this because the signal > handler's function is almost the same (the original handler was more > generic). default behavior with SIGINT is to terminate, and going by this patch, no one set up a signal handler for SIGINT. so the fix as you implied sounds like: - call signal(SIGINT, SIG_IGN); - delete sighandlerr() -mike [-- Attachment #1.2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 399 bytes --] ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference [-- Attachment #3: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT 2009-10-12 18:36 ` Mike Frysinger @ 2009-10-13 9:40 ` liubo 0 siblings, 0 replies; 4+ messages in thread From: liubo @ 2009-10-13 9:40 UTC (permalink / raw) To: ltp-list; +Cc: Mike Frysinger [-- Attachment #1.1: Type: text/plain, Size: 2847 bytes --] On 12/24/-28158 03:59 AM, Mike Frysinger wrote: > On Monday 12 October 2009 14:28:02 Garrett Cooper wrote: > >> On Mon, Oct 12, 2009 at 2:39 AM, liubo <liubo-fnst@cn.fujitsu.com> wrote: >> >>> The test case ppoll01 does not register the signal handler >>> of SIGINT, so the program will be terminated by SIGINT >>> from child process. >>> >>> Then, the rest cases will not be tested. >>> >>> This patch fixed the problem. >>> >>> --- a/testcases/kernel/syscalls/ppoll/ppoll01.c >>> +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c >>> @@ -124,9 +124,17 @@ extern void cleanup() { >>> +/* >>> + * sighandler() >>> + */ >>> +void sighandler(int sig) >>> +{ >>> + return; >>> +} >>> void setup() { >>> /* Capture signals if any */ >>> - /* Create temporary directories */ >>> + signal(SIGINT, sighandler); >>> + /* Create temporary directories */ >>> TEST_PAUSE; >>> tst_tmpdir(); >>> } >>> @@ -404,16 +412,6 @@ TEST_END: >>> } >>> >>> >>> -/* >>> - * sighandler() >>> - */ >>> -void sighandler(int sig) >>> -{ >>> - if (sig == SIGINT) >>> - return; >>> - // NOTREACHED >>> - return; >>> -} >>> >> 1. If all that the signal handler does is just return, it should have >> been doing SIG_IGN from the beginning. >> 2. I don't understand how your change fixes this because the signal >> handler's function is almost the same (the original handler was more >> generic). >> > > default behavior with SIGINT is to terminate, and going by this patch, no one > set up a signal handler for SIGINT. so the fix as you implied sounds like: > - call signal(SIGINT, SIG_IGN); > - delete sighandlerr() > -mike > > Mike, I apply your suggestions on a X86_64 system, and it shows signal(SIGINT, SIG_IGN) also blocks the case04 itself. { // case04 .ttype = SEND_SIGINT, .ret = -1, .err = EINTR, }, Then, the testcase will hang on here. So, I suggest we remain "void sighandler(int sig)" to fix the problem. Thanks, > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > Ltp-list mailing list > Ltp-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/ltp-list > [-- Attachment #1.2: Type: text/html, Size: 4072 bytes --] [-- Attachment #2: Type: text/plain, Size: 399 bytes --] ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference [-- Attachment #3: Type: text/plain, Size: 155 bytes --] _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-13 9:41 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-12 9:39 [LTP] [PATCH] ppoll01: Fix to set the signal handler of SIGINT liubo 2009-10-12 18:28 ` Garrett Cooper 2009-10-12 18:36 ` Mike Frysinger 2009-10-13 9:40 ` liubo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox