* [LTP] [PATCH] waitpid02: avoid core file
@ 2012-11-14 9:36 Jan Stancek
2012-11-20 2:23 ` Wanlong Gao
0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2012-11-14 9:36 UTC (permalink / raw)
To: ltp-list
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 <jstancek@redhat.com>
---
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [LTP] [PATCH] waitpid02: avoid core file
2012-11-14 9:36 [LTP] [PATCH] waitpid02: avoid core file Jan Stancek
@ 2012-11-20 2:23 ` Wanlong Gao
0 siblings, 0 replies; 2+ messages in thread
From: Wanlong Gao @ 2012-11-20 2:23 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list
On 11/14/2012 05:36 PM, Jan Stancek wrote:
> 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 <jstancek@redhat.com>
Applied, thank you.
Wanlong Gao
------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-20 2:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-14 9:36 [LTP] [PATCH] waitpid02: avoid core file Jan Stancek
2012-11-20 2:23 ` Wanlong Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox