All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mprotect02: fix error of the case need sighandler()
@ 2011-01-20  8:00 Peng Haitao
  2011-01-20  9:28 ` Garrett Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Peng Haitao @ 2011-01-20  8:00 UTC (permalink / raw)
  To: Garrett Cooper; +Cc: ltp-list

Hi Garrett,

The case expect the signal "SIGSEGV", so should add sighandler().

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>

---
 testcases/kernel/syscalls/mprotect/mprotect02.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/mprotect/mprotect02.c b/testcases/kernel/syscalls/mprotect/mprotect02.c
index ebc4bcc..36c41de 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect02.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect02.c
@@ -198,12 +198,21 @@ int main()
 
 #endif /* UCLINUX */
 
+void sighandler(int sig)
+{
+	tst_resm(TINFO, "received signal: %d", sig);
+	if (sig == SIGSEGV)
+		exit(1);
+	else
+		tst_brkm(TBROK, 0, "Unexpected signal %d received.", sig);
+}
+
 /*
  * setup() - performs all ONE TIME setup for this test
  */
 void setup()
 {
-	tst_sig(FORK, DEF_HANDLER, NULL);
+	tst_sig(FORK, sighandler, NULL);
 
 	TEST_PAUSE;
 
-- 
1.7.3.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2011-01-21  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20  8:00 [LTP] [PATCH] mprotect02: fix error of the case need sighandler() Peng Haitao
2011-01-20  9:28 ` Garrett Cooper
2011-01-21  3:55   ` Peng Haitao
2011-01-21  4:00     ` Garrett Cooper
2011-01-21  5:38       ` Peng Haitao
2011-01-21  8:29         ` Garrett Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.