fix: build failure on ppc64el with '-Werror=format-overflow='
[babeltrace.git] / src / lib / plugin / plugin-so.c
index ebdbf8239fa6b7d8112f9354c8d22c8a0010b066..06c0b6342e38e6cb290f48c3d66de289d64ca44e 100644 (file)
@@ -32,9 +32,6 @@
 #include <babeltrace2/plugin/plugin-dev.h>
 #include "lib/graph/component-class.h"
 #include <babeltrace2/graph/component-class.h>
-#include <babeltrace2/graph/component-class-source.h>
-#include <babeltrace2/graph/component-class-filter.h>
-#include <babeltrace2/graph/component-class-sink.h>
 #include <babeltrace2/types.h>
 #include "common/list.h"
 #include <string.h>
@@ -87,6 +84,11 @@ BT_PLUGIN_MODULE();
  * component class is removed from this list, the shared library handle
  * object's reference count falls to zero and the shared library is
  * finally closed.
+ *
+ * We're not using a GLib linked list here because this destructor is
+ * called after GLib's thread-specific data is destroyed, which contains
+ * the allocated memory for GLib data structures (what's used by
+ * g_slice_alloc()).
  */
 
 static
@@ -174,7 +176,7 @@ int bt_plugin_so_shared_lib_handle_create(
        int status = BT_FUNC_STATUS_OK;
 
        BT_ASSERT(shared_lib_handle);
-       BT_LOGI("Creating shared library handle: path=\"%s\"", path);
+       BT_LOGI("Creating shared library handle: path=\"%s\"", path ? path : "(null)");
        *shared_lib_handle = g_new0(struct bt_plugin_so_shared_lib_handle, 1);
        if (!*shared_lib_handle) {
                BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one shared library handle.");
@@ -218,7 +220,7 @@ end:
        BT_ASSERT(*shared_lib_handle || status != BT_FUNC_STATUS_OK);
        if (*shared_lib_handle) {
                BT_LOGI("Created shared library handle: path=\"%s\", addr=%p",
-                       path, *shared_lib_handle);
+                       path ? path : "(null)", *shared_lib_handle);
        }
 
        return status;
This page took 0.026793 seconds and 4 git commands to generate.