public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
@ 2009-10-01  8:10 Chandru
  2009-10-13 12:13 ` Subrata Modak
  0 siblings, 1 reply; 8+ messages in thread
From: Chandru @ 2009-10-01  8:10 UTC (permalink / raw)
  To: ltp-list; +Cc: vapier

The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
The following patch
1. Adds a signal() syscall to register the signal handler
2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.

Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
---
 testcases/kernel/syscalls/ppoll/ppoll01.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- testcases/kernel/syscalls/ppoll/ppoll01.c.orig	2009-09-29 21:28:55.510487735 +0530
+++ testcases/kernel/syscalls/ppoll/ppoll01.c	2009-10-01 18:27:30.452236128 +0530
@@ -79,6 +79,8 @@ char *TCID = "ppoll01";  /* Test program
 int  testno;
 int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
 
+void sighandler(int sig);       /* signals handler function for the test */
+
 /* Extern Global Functions */
 /******************************************************************************/
 /*                                                                            */
@@ -125,7 +127,8 @@ extern void cleanup() {
 /*                                                                            */
 /******************************************************************************/
 void setup() {
-        /* Capture signals if any */
+        /* Capture signals */
+	signal(SIGINT, &sighandler);
         /* Create temporary directories */
         TEST_PAUSE;
         tst_tmpdir();
@@ -191,7 +194,7 @@ struct test_case {
 static struct test_case tcase[] = {
 	{ // case00
                 .ttype          = NORMAL,
-                .expect_revents = POLLOUT,
+                .expect_revents = POLLOUT | POLLIN,
                 .ret            = 0,
                 .err            = 0,
         },

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; 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&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-15 12:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01  8:10 [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler Chandru
2009-10-13 12:13 ` Subrata Modak
2009-10-14  6:41   ` Chandru
2009-10-14 20:28     ` Subrata Modak
2009-10-15  1:25       ` Garrett Cooper
2009-10-15  8:44         ` Chandru
2009-10-15 12:43           ` Garrett Cooper
2009-10-15 12:45             ` Garrett Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox