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 <[email protected]>
---
 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


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to