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

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