Always enable .pid core file extension
authorWilliam Douglas <william.douglas@intel.com>
Tue, 12 Feb 2013 23:09:44 +0000 (15:09 -0800)
committerWilliam Douglas <william.douglas@intel.com>
Tue, 12 Feb 2013 23:23:50 +0000 (15:23 -0800)
Change-Id: I134d6d06d9cd507ddb25ee40fb48516466c116a7
Signed-off-by: William Douglas <william.douglas@intel.com>
src/coredump.c

index d84ec6a..7525f28 100644 (file)
@@ -757,6 +757,17 @@ void enable_corefiles(int diskfree)
        if (ret == -1)
                goto err;
 
+       proc_core_string = NULL;
+       ret = asprintf(&proc_core_string,
+                       "echo 1 > /proc/sys/kernel/core_uses_pid");
+       if (ret == -1)
+               goto err;
+
+       ret = system(proc_core_string);
+       free(proc_core_string);
+       if (ret == -1)
+               goto err;
+
        if (diskfree == -1) {
                fprintf(stderr, "+ enabled core pattern\n");
                syslog(LOG_INFO, "corewatcher: enabled kernel core_pattern\n");