From: Jan S. <jst...@re...> - 2012-11-14 09:36:49
|
Depending on configuration this testcase may create core file with various location and name. The signal causing core dump is here by design so this core file isn't interesting. Avoid this core file by setting RLIMIT_CORE to 1. Signed-off-by: Jan Stancek <jst...@re...> --- testcases/kernel/syscalls/waitpid/waitpid02.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/syscalls/waitpid/waitpid02.c b/testcases/kernel/syscalls/waitpid/waitpid02.c index ae0446e..6db43c2 100644 --- a/testcases/kernel/syscalls/waitpid/waitpid02.c +++ b/testcases/kernel/syscalls/waitpid/waitpid02.c @@ -50,6 +50,7 @@ */ #include <sys/file.h> +#include <sys/resource.h> #include <sys/signal.h> #include <sys/types.h> #include <sys/wait.h> @@ -145,10 +146,6 @@ int main(int argc, char **argv) } } } - - if (access("core", F_OK) == 0) { - unlink("core"); - } } cleanup(); tst_exit(); @@ -174,6 +171,13 @@ void do_child() */ void setup(void) { + /* SIGFPE is expected signal, so avoid creating any corefile. + * '1' is a special value, that will also avoid dumping via pipe. */ + struct rlimit r; + r.rlim_cur = 1; + 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. */ -- 1.7.1 |