From: Peng Haitao <penght@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: [LTP] [PATCH] mprotect02: fix error of the case need sighandler()
Date: Thu, 20 Jan 2011 16:00:18 +0800 [thread overview]
Message-ID: <4D37EB92.3060901@cn.fujitsu.com> (raw)
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
next reply other threads:[~2011-01-20 8:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 8:00 Peng Haitao [this message]
2011-01-20 9:28 ` [LTP] [PATCH] mprotect02: fix error of the case need sighandler() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D37EB92.3060901@cn.fujitsu.com \
--to=penght@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.