From: Garrett C. <su...@li...> - 2011-01-10 03:57:43
|
The branch, master, has been updated via 75b5a4b8b4e56f371579930157707e959a72ff26 (commit) from 6be4ba4589c8370dd4272a2fb5eccb568770f8b1 (commit) - Log ----------------------------------------------------------------- commit 75b5a4b8b4e56f371579930157707e959a72ff26 Author: Garrett Cooper <yan...@gm...> Date: Mon Dec 20 15:56:11 2010 -0800 Fix testcase. 1. It was propagating the signal handler to the child incorrectly. 2. It was masking a lot more signals than necessary before. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/ppoll/ppoll01.c | 52 +++++----------------------- 1 files changed, 10 insertions(+), 42 deletions(-) diff --git a/testcases/kernel/syscalls/ppoll/ppoll01.c b/testcases/kernel/syscalls/ppoll/ppoll01.c index 101fda0..0483835 100644 --- a/testcases/kernel/syscalls/ppoll/ppoll01.c +++ b/testcases/kernel/syscalls/ppoll/ppoll01.c @@ -79,60 +79,28 @@ #define POLLRDHUP 0x2000 #endif -/* Extern Global Variables */ - -/* Global Variables */ char *TCID = "ppoll01"; /* Test program identifier.*/ int testno; int TST_TOTAL = 1; /* total number of tests in this file. */ -/* Extern Global Functions */ -/******************************************************************************/ -/* */ -/* Function: cleanup */ -/* */ -/* Description: Performs all one time clean up for this test on successful */ -/* completion, premature exit or failure. Closes all temporary */ -/* files, removes all temporary directories exits the test with */ -/* appropriate return code by calling tst_exit() function. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits calling tst_exit(). Non '0' return code. */ -/* On success - Exits calling tst_exit(). With '0' return code. */ -/* */ -/******************************************************************************/ +void +sighandler(int sig) +{ + if (sig == SIGINT) + return; + else + tst_brkm(TBROK, NULL, "received unexpected signal %d", sig); +} + void cleanup() { TEST_CLEANUP; tst_rmdir(); } -/* Local Functions */ -/******************************************************************************/ -/* */ -/* Function: setup */ -/* */ -/* Description: Performs all one time setup for this test. This function is */ -/* typically used to capture signals, create temporary dirs */ -/* and temporary files that may be used in the course of this */ -/* test. */ -/* */ -/* Input: None. */ -/* */ -/* Output: None. */ -/* */ -/* Return: On failure - Exits by calling cleanup(). */ -/* On success - returns 0. */ -/* */ -/******************************************************************************/ void setup() { - /* Capture signals if any */ - tst_sig(NOFORK, SIG_IGN, cleanup); + tst_sig(FORK, sighandler, cleanup); - /* Create temporary directories */ TEST_PAUSE; tst_tmpdir(); } hooks/post-receive -- ltp |