Blob Blame Raw
From 48c53164aebf9c07606e08f7108d0f7272d48d70 Mon Sep 17 00:00:00 2001
From: Richard Marko <rmarko@fedoraproject.org>
Date: Fri, 17 Jul 2015 13:52:35 +0200
Subject: [PATCH] abrt-hook-ccpp: save core_backtrace from hook

Don't use satyr for saving the file.

Signed-off-by: Richard Marko <rmarko@fedoraproject.org>
---
 src/hooks/abrt-hook-ccpp.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
index d95228f..6759fc0 100644
--- a/src/hooks/abrt-hook-ccpp.c
+++ b/src/hooks/abrt-hook-ccpp.c
@@ -585,21 +585,25 @@ static int create_or_die(const char *filename, int user_core_fd)
     perror_msg_and_die("Can't open '%s'", filename);
 }
 
-static void create_core_backtrace(pid_t tid, const char *executable, int signal_no, const char *dd_path)
+static void create_core_backtrace(pid_t tid, const char *executable, int signal_no, struct dump_dir *dd)
 {
 #ifdef ENABLE_DUMP_TIME_UNWIND
     if (g_verbose > 1)
         sr_debug_parser = true;
 
     char *error_message = NULL;
-    bool success = sr_abrt_create_core_stacktrace_from_core_hook(dd_path, tid, executable,
-                                                                 signal_no, &error_message);
+    char *core_bt = sr_abrt_get_core_stacktrace_from_core_hook(tid, executable,
+                                                               signal_no, &error_message);
 
-    if (!success)
+    if (core_bt == NULL)
     {
         log("Failed to create core_backtrace: %s", error_message);
         free(error_message);
+        return;
     }
+
+    dd_save_text(dd, FILENAME_CORE_BACKTRACE, core_bt);
+    free(core_bt);
 #endif /* ENABLE_DUMP_TIME_UNWIND */
 }
 
@@ -1028,7 +1032,7 @@ int main(int argc, char** argv)
 
         /* Perform crash-time unwind of the guilty thread. */
         if (tid > 0 && setting_CreateCoreBacktrace)
-            create_core_backtrace(tid, executable, signal_no, dd->dd_dirname);
+            create_core_backtrace(tid, executable, signal_no, dd);
 
         /* We close dumpdir before we start catering for crash storm case.
          * Otherwise, delete_dump_dir's from other concurrent
-- 
2.4.3