From: Cyril H. <su...@li...> - 2012-11-20 06:57:02
|
The branch, master, has been updated via 04cfe1bb3043e373f65e35a35705319cbeba163c (commit) via ae24b14de610636c5d5515c9840500ee64abd41e (commit) via f1fd88c97ee1885985795f7c148b47792d9aa497 (commit) via bfca91c02b5edf8c8bdc55d54a681327e06ce505 (commit) via 4aeecee8b209ce5a70e5d7edeb66625c085eb2fc (commit) via ed7dbc5ac13253cbdb60874773705ad4c56f769e (commit) via 5086d421be015b45dbe40af25a77e3841c0d8851 (commit) via dd62135f2b3482ba6a623e2bb0d3d1965fffa4da (commit) via 2c58f605b021a69c199b2be2d65642d85fe631f1 (commit) via bdb27442a16270654675ebdb7ea912d09fe392d1 (commit) via d08183cd4a330833bd8e7e3abf554bcdf254c65f (commit) via 9554de5f32d1a923cc57e509bbe30ad86b807c28 (commit) via 23e89833076820f13dc2a8298e6c42abac96cf1c (commit) from d0bebd62a6cff6c796b8dda104a052ccc7ff2938 (commit) - Log ----------------------------------------------------------------- commit 04cfe1bb3043e373f65e35a35705319cbeba163c Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid13: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit ae24b14de610636c5d5515c9840500ee64abd41e Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid12: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit f1fd88c97ee1885985795f7c148b47792d9aa497 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid11: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit bfca91c02b5edf8c8bdc55d54a681327e06ce505 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid10: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit 4aeecee8b209ce5a70e5d7edeb66625c085eb2fc Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid09: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit ed7dbc5ac13253cbdb60874773705ad4c56f769e Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid08: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit 5086d421be015b45dbe40af25a77e3841c0d8851 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid07: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit dd62135f2b3482ba6a623e2bb0d3d1965fffa4da Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid06: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit 2c58f605b021a69c199b2be2d65642d85fe631f1 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid05: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit bdb27442a16270654675ebdb7ea912d09fe392d1 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid04: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit d08183cd4a330833bd8e7e3abf554bcdf254c65f Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid03: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit 9554de5f32d1a923cc57e509bbe30ad86b807c28 Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid02: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> commit 23e89833076820f13dc2a8298e6c42abac96cf1c Author: Wanlong Gao <gao...@cn...> Date: Tue Nov 20 10:32:33 2012 +0800 waitpid01: code cleanups Cleanup the coding style. Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/waitpid/waitpid01.c | 43 ++----- testcases/kernel/syscalls/waitpid/waitpid02.c | 44 ++----- testcases/kernel/syscalls/waitpid/waitpid03.c | 51 +++------ testcases/kernel/syscalls/waitpid/waitpid04.c | 44 ++----- testcases/kernel/syscalls/waitpid/waitpid05.c | 62 +++------- testcases/kernel/syscalls/waitpid/waitpid06.c | 87 +++++--------- testcases/kernel/syscalls/waitpid/waitpid07.c | 91 +++++--------- testcases/kernel/syscalls/waitpid/waitpid08.c | 93 ++++++--------- testcases/kernel/syscalls/waitpid/waitpid09.c | 104 ++++++---------- testcases/kernel/syscalls/waitpid/waitpid10.c | 163 +++++++++---------------- testcases/kernel/syscalls/waitpid/waitpid11.c | 60 +++++----- testcases/kernel/syscalls/waitpid/waitpid12.c | 67 +++++----- testcases/kernel/syscalls/waitpid/waitpid13.c | 92 +++++++------- 13 files changed, 371 insertions(+), 630 deletions(-) diff --git a/testcases/kernel/syscalls/waitpid/waitpid01.c b/testcases/kernel/syscalls/waitpid/waitpid01.c index 5241b94..b26d19a 100644 --- a/testcases/kernel/syscalls/waitpid/waitpid01.c +++ b/testcases/kernel/syscalls/waitpid/waitpid01.c @@ -52,8 +52,8 @@ #include "test.h" #include "usctest.h" -void setup(void); -void cleanup(void); +static void setup(void); +static void cleanup(void); char *TCID = "waitpid01"; int TST_TOTAL = 1; @@ -66,12 +66,10 @@ int main(int argc, char **argv) int pid, npid, sig, nsig; int exno, nexno, status; - if ((msg = parse_opts(argc, argv, NULL, NULL)) != - NULL) { + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - } - setup(); /* check for looping state if -i option is given */ @@ -82,7 +80,8 @@ int main(int argc, char **argv) exno = 1; sig = 14; - if ((pid = FORK_OR_VFORK()) < 0) { + pid = FORK_OR_VFORK(); + if (pid < 0) { tst_brkm(TFAIL, cleanup, "Fork Failed"); } else if (pid == 0) { alarm(2); @@ -92,9 +91,8 @@ int main(int argc, char **argv) errno = 0; while (((npid = waitpid(pid, &status, 0)) != -1) || (errno == EINTR)) { - if (errno == EINTR) { + if (errno == EINTR) continue; - } if (npid != pid) { tst_resm(TFAIL, "waitpid error: " @@ -132,37 +130,18 @@ int main(int argc, char **argv) } } } + cleanup(); tst_exit(); - } -/* - * setup() - * performs all ONE TIME setup for this test - */ -void setup(void) +static void setup(void) { - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ TEST_PAUSE; } -/* - * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit - */ -void cleanup(void) +static void cleanup(void) { - tst_sig(FORK, DEF_HANDLER, cleanup); - - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - - } +} diff --git a/testcases/kernel/syscalls/waitpid/waitpid02.c b/testcases/kernel/syscalls/waitpid/waitpid02.c index 6db43c2..f40449c 100644 --- a/testcases/kernel/syscalls/waitpid/waitpid02.c +++ b/testcases/kernel/syscalls/waitpid/waitpid02.c @@ -58,9 +58,9 @@ #include "test.h" #include "usctest.h" -void do_child(void); -void setup(void); -void cleanup(void); +static void do_child(void); +static void setup(void); +static void cleanup(void); char *TCID = "waitpid02"; int TST_TOTAL = 1; @@ -73,10 +73,9 @@ int main(int argc, char **argv) int pid, npid, sig, nsig; int exno, nexno, status; - if ((msg = parse_opts(argc, argv, NULL, NULL)) != - NULL) { + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - } #ifdef UCLINUX maybe_run_child(&do_child, ""); #endif @@ -105,9 +104,8 @@ int main(int argc, char **argv) errno = 0; while (((npid = waitpid(pid, &status, 0)) != -1) || (errno == EINTR)) { - if (errno == EINTR) { + if (errno == EINTR) continue; - } if (npid != pid) { tst_resm(TFAIL, "waitpid error: " @@ -147,15 +145,12 @@ int main(int argc, char **argv) } } } + cleanup(); tst_exit(); - } -/* - * do_child() - */ -void do_child() +static void do_child(void) { int exno = 1; @@ -165,11 +160,7 @@ void do_child() exit(exno); } -/* - * setup() - * performs all ONE TIME setup for this test - */ -void setup(void) +static void setup(void) { /* SIGFPE is expected signal, so avoid creating any corefile. * '1' is a special value, that will also avoid dumping via pipe. */ @@ -178,23 +169,10 @@ void setup(void) r.rlim_max = 1; setrlimit(RLIMIT_CORE, &r); - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ TEST_PAUSE; } -/* - * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit - */ -void cleanup(void) +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - - } +} diff --git a/testcases/kernel/syscalls/waitpid/waitpid03.c b/testcases/kernel/syscalls/waitpid/waitpid03.c index 1309d2f..e317ade 100644 --- a/testcases/kernel/syscalls/waitpid/waitpid03.c +++ b/testcases/kernel/syscalls/waitpid/waitpid03.c @@ -56,19 +56,19 @@ #include "test.h" #include "usctest.h" -void do_child(int); -void setup(void); -void cleanup(void); +static void do_child(int); +static void setup(void); +static void cleanup(void); char *TCID = "waitpid03"; int TST_TOTAL = 1; #define MAXUPRC 25 -int condition_number; +static int condition_number; #ifdef UCLINUX -void do_child_uclinux(void); +static void do_child_uclinux(void); static int ikids_uclinux; #endif @@ -79,11 +79,9 @@ int main(int argc, char **argv) int status, pid[25], ret; - if ((msg = parse_opts(argc, argv, NULL, NULL)) != - NULL) { + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - - } #ifdef UCLINUX maybe_run_child(&do_child, "d", &ikids_uclinux); #endif @@ -107,7 +105,8 @@ int main(int argc, char **argv) } while (++ikids < MAXUPRC) { - if ((pid[ikids] = FORK_OR_VFORK()) > 0) { + pid[ikids] = FORK_OR_VFORK(); + if (pid[ikids] > 0) { if (DEBUG) tst_resm(TINFO, "child # %d", ikids); } else if (pid[ikids] == -1) { @@ -159,15 +158,12 @@ int main(int argc, char **argv) } condition_number++; } + cleanup(); tst_exit(); - } -/* - * do_child() - */ -void do_child(int ikids) +static void do_child(int ikids) { if (DEBUG) tst_resm(TINFO, "child:%d", ikids); @@ -180,35 +176,18 @@ void do_child(int ikids) * do_child_uclinux() * run do_child with the appropriate ikids variable */ -void do_child_uclinux() +static void do_child_uclinux(void) { do_child(ikids_uclinux); } #endif -/* - * setup() - * performs all ONE TIME setup for this test - */ -void setup(void) +static void setup(void) { - /* Pause if that option was specified - * TEST_PAUSE contains the code to fork the test with the -c option. - */ TEST_PAUSE; } -/* - * cleanup() - * performs all ONE TIME cleanup for this test at - * completion or premature exit - */ -void cleanup(void) +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; - - } +} diff --git a/testcases/kernel/syscalls/waitpid/waitpid04.c b/testcases/kernel/syscalls/waitpid/waitpid04.c index f3b32fd..517569d 100644 --- a/testcases/kernel/syscalls/waitpid/waitpid04.c +++ b/testcases/kernel/syscalls/waitpid/waitpid04.c @@ -48,18 +48,18 @@ #include "test.h" #include "usctest.h" -void setup(void); -void cleanup(void); +static void setup(void); +static void cleanup(void); /* 0 terminated list of expected errnos */ -int exp_enos[] = { 10, 22, 0 }; +static int exp_enos[] = { 10, 22, 0 }; char *TCID = "waitpid04"; int TST_TOTAL = 1; #define INVAL_FLAG -1 -int flag, condition_number; +static int flag, condition_number; int main(int ac, char **av) { @@ -68,11 +68,10 @@ int main(int ac, char **av) int lc; char *msg; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { + msg = parse_opts(ac, av, NULL, NULL); + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - } - setup(); /* check for looping state if -i option is given */ @@ -99,9 +98,9 @@ int main(int ac, char **av) } condition_number++; - if (FORK_OR_VFORK() == 0) { + if (FORK_OR_VFORK() == 0) exit(0); - } + pid = 1; ret = waitpid(pid, &status, WUNTRACED); flag = 0; @@ -140,37 +139,20 @@ int main(int ac, char **av) } condition_number++; } + cleanup(); tst_exit(); - } -/* - * setup() - * performs all ONE TIME setup for this test - */ -void setup(void) +static void setup(void) { /* Set up the expected error numbers for -e option */ TEST_EXP_ENOS(exp_enos); - /* Paus |