[PATCH v3 3/5] kernel-shark-2.alpha: Print the plugin's file name in case of loading error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@xxxxxxxxx>

When dlopen() fails to load the plugin, "plugin->file" is still not initialized.
It is useful to print the file name of the problematic plugin, "file", instead of not
yet initialized "plugin->file".

Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@xxxxxxxxx>
---
 src/libkshark-plugin.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/libkshark-plugin.c b/src/libkshark-plugin.c
index f9a721f..1cea87b 100644
--- a/src/libkshark-plugin.c
+++ b/src/libkshark-plugin.c
@@ -331,8 +331,7 @@ kshark_register_plugin(struct kshark_context *kshark_ctx,
 	return plugin;
 
  fail:
-	fprintf(stderr, "cannot load plugin '%s'\n",
-		plugin->file);
+	fprintf(stderr, "cannot load plugin '%s'\n", file);
 
 	if (plugin->handle)
 		dlclose(plugin->handle);
-- 
2.25.1




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux