Be a bit clearer about core-dumping messages (don't say we are if we're not)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2320 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c
index fedb3be..e7b6019 100644
--- a/coregrind/vg_signals.c
+++ b/coregrind/vg_signals.c
@@ -1716,6 +1716,18 @@
sigNo, terminate ? "terminate" : "", core ? "+core" : "");
if (terminate) {
+ if (core) {
+ /* If they set the core-size limit to zero, don't generate a
+ core file */
+ static struct vki_rlimit zero = { 0, 0 };
+ struct vki_rlimit corelim;
+
+ VG_(getrlimit)(VKI_RLIMIT_CORE, &corelim);
+
+ if (corelim.rlim_cur == 0)
+ core = False;
+ }
+
if (VG_(clo_verbosity) != 0 && (core || VG_(clo_verbosity) > 1)) {
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "Process terminating with default action of signal %d (%s)%s",
@@ -1784,13 +1796,7 @@
}
if (core) {
- static struct vki_rlimit zero = { 0, 0 };
- struct vki_rlimit corelim;
-
- VG_(getrlimit)(VKI_RLIMIT_CORE, &corelim);
-
- if (corelim.rlim_cur > 0)
- make_coredump(tid, info, corelim.rlim_cur);
+ make_coredump(tid, info, corelim.rlim_cur);
/* make sure we don't get a confusing kernel-generated coredump */
VG_(setrlimit)(VKI_RLIMIT_CORE, &zero);