]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Be a bit clearer about core-dumping messages (don't say we are if we're not)
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 15 Mar 2004 23:44:11 +0000 (23:44 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Mon, 15 Mar 2004 23:44:11 +0000 (23:44 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2320

coregrind/vg_signals.c

index fedb3beadc6507ff1011f4cd973c505055f1e6d6..e7b601920ef3a53841f2bf3cf7f2104ac1620ef6 100644 (file)
@@ -1716,6 +1716,18 @@ static void vg_default_action(const vki_ksiginfo_t *info, ThreadId tid)
                   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 @@ static void vg_default_action(const vki_ksiginfo_t *info, ThreadId tid)
       }
 
       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);