Add bt_common_abort() and use it instead of abort() directly
[babeltrace.git] / src / lib / lib-logging.c
index 8d357e30524c811059cb41b45167a7d874cd54cf..242f88d645fdaa20e8408ba6004c22f77debf8c4 100644 (file)
@@ -111,7 +111,7 @@ static __thread char lib_logging_buf[LIB_LOGGING_BUF_SIZE];
                                prefix, (_prefix2));                    \
                                                                        \
                if (snprintf_ret < 0 || snprintf_ret >= TMP_PREFIX_LEN - 1) { \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
                                                                        \
                tmp_prefix[TMP_PREFIX_LEN - 1] = '\0';                  \
@@ -490,7 +490,7 @@ static inline void format_field_path(char **buf_ch, bool extended,
                        BUF_APPEND("%s", ", <CUR>");
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -1481,7 +1481,7 @@ static inline void handle_conversion_specifier_bt(void *priv_data,
                format_error_cause(buf_ch, extended, prefix, obj);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 update_fmt:
@@ -1522,7 +1522,8 @@ void bt_lib_maybe_log_and_append_cause(const char *func, const char *file,
        }
 
        status = bt_current_thread_error_append_cause_from_unknown(
-               "Babeltrace library", file, line, "%s", lib_logging_buf);
+               BT_LIB_LOG_LIBBABELTRACE2_NAME, file, line, "%s",
+               lib_logging_buf);
        if (status) {
                /*
                 * Worst case: this error cause is not appended to the
This page took 0.024131 seconds and 4 git commands to generate.