Blame SOURCES/0152-abrt-hook-ccpp-save-core_backtrace-from-hook.patch

a60cd7
From 48c53164aebf9c07606e08f7108d0f7272d48d70 Mon Sep 17 00:00:00 2001
a60cd7
From: Richard Marko <rmarko@fedoraproject.org>
a60cd7
Date: Fri, 17 Jul 2015 13:52:35 +0200
a60cd7
Subject: [PATCH] abrt-hook-ccpp: save core_backtrace from hook
a60cd7
a60cd7
Don't use satyr for saving the file.
a60cd7
a60cd7
Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
a60cd7
---
a60cd7
 src/hooks/abrt-hook-ccpp.c | 14 +++++++++-----
a60cd7
 1 file changed, 9 insertions(+), 5 deletions(-)
a60cd7
a60cd7
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
a60cd7
index d95228f..6759fc0 100644
a60cd7
--- a/src/hooks/abrt-hook-ccpp.c
a60cd7
+++ b/src/hooks/abrt-hook-ccpp.c
a60cd7
@@ -585,21 +585,25 @@ static int create_or_die(const char *filename, int user_core_fd)
a60cd7
     perror_msg_and_die("Can't open '%s'", filename);
a60cd7
 }
a60cd7
 
a60cd7
-static void create_core_backtrace(pid_t tid, const char *executable, int signal_no, const char *dd_path)
a60cd7
+static void create_core_backtrace(pid_t tid, const char *executable, int signal_no, struct dump_dir *dd)
a60cd7
 {
a60cd7
 #ifdef ENABLE_DUMP_TIME_UNWIND
a60cd7
     if (g_verbose > 1)
a60cd7
         sr_debug_parser = true;
a60cd7
 
a60cd7
     char *error_message = NULL;
a60cd7
-    bool success = sr_abrt_create_core_stacktrace_from_core_hook(dd_path, tid, executable,
a60cd7
-                                                                 signal_no, &error_message);
a60cd7
+    char *core_bt = sr_abrt_get_core_stacktrace_from_core_hook(tid, executable,
a60cd7
+                                                               signal_no, &error_message);
a60cd7
 
a60cd7
-    if (!success)
a60cd7
+    if (core_bt == NULL)
a60cd7
     {
a60cd7
         log("Failed to create core_backtrace: %s", error_message);
a60cd7
         free(error_message);
a60cd7
+        return;
a60cd7
     }
a60cd7
+
a60cd7
+    dd_save_text(dd, FILENAME_CORE_BACKTRACE, core_bt);
a60cd7
+    free(core_bt);
a60cd7
 #endif /* ENABLE_DUMP_TIME_UNWIND */
a60cd7
 }
a60cd7
 
a60cd7
@@ -1028,7 +1032,7 @@ int main(int argc, char** argv)
a60cd7
 
a60cd7
         /* Perform crash-time unwind of the guilty thread. */
a60cd7
         if (tid > 0 && setting_CreateCoreBacktrace)
a60cd7
-            create_core_backtrace(tid, executable, signal_no, dd->dd_dirname);
a60cd7
+            create_core_backtrace(tid, executable, signal_no, dd);
a60cd7
 
a60cd7
         /* We close dumpdir before we start catering for crash storm case.
a60cd7
          * Otherwise, delete_dump_dir's from other concurrent
a60cd7
-- 
a60cd7
2.4.3
a60cd7