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

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